Hi to all,Today I read the reference manual 'in diagonal'. (I do not have time right now) but I did not find answers to these questions:1. What is the meaning of .psl and .psi. What is their relation and purpose. A real world example would help (I think I get it, psi is probably ParaSail Interface, but psl... )
2. Is it possible to interface C? I think so, but because I read on this forum that the GTK examples are broken ... I can not test and wrap my head around how to do it. I am interested in testing just a small native windows API call, eg. mouse position and maybe report that on the command line. This would be the base for another quick and dirty tutorial. So can you point me a working and basic example?
3. While we are at it, how to interface Ada code? Any example, simple toy, working?
Thank you,Olivier
--
You received this message because you are subscribed to the Google Groups "ParaSail Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to parasail-programming...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/parasail-programming-language/cd44a12f-87ef-4280-8979-8f9039b505b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
...
The 8.0 version of ParaSail supports specifying the "convention" of a given operation implemented in some other language, and declared using "is import(#XXX, convention => #YYY)".
...If you specify "is import(#my_c_routine, #c)" it will pass the parameters using the "normal" C calling conventions, and not pass a "context" record nor a type descriptor. ...
......
3. While we are at it, how to interface Ada code? Any example, simple toy, working?Thank you,Olivier
@C:\parasail_release_8_0\bin\parasail_main.exe "C:\parasail_release_8_0\lib\aaa.psi" "C:\parasail_release_8_0\lib\reflection.psl" "C:\parasail_release_8_0\lib\reflection.psi" "C:\parasail_release_8_0\lib\psvm_debugging.psl" "C:\parasail_release_8_0\lib\debugger_console.psl" %*
--
You received this message because you are subscribed to the Google Groups "ParaSail Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to parasail-programming...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/parasail-programming-language/a2495e79-cf32-41e3-b501-4d8f5fcd80ac%40googlegroups.com.
New newbie questions :)1. Parasail has no 'import module' mecanism yet, right? Is loading module definitions upfront at the compiler cmd the long term way to go?
2. What is the prefered setup on windows to use csh?
3. Is it possible/how to represent 'heterogeneous dictionaries' like an incomming json object?
I ask because this is kind of bread and butter of current microservices communications practices and I suspect the huge success of Javascript and Python to be strongly coupled to the low friction one has to share 'communication objects'
--
You received this message because you are subscribed to the Google Groups "ParaSail Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to parasail-programming...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/parasail-programming-language/a3c39a89-c2b0-4117-ab70-715ba2e807de%40googlegroups.com.
On Wed, Feb 19, 2020 at 8:44 AM Olivier Henley <olivier...@gmail.com> wrote:
...
3. Is it possible/how to represent 'heterogeneous dictionaries' like an incomming json object?There is no standard "json" parser, though you could certainly write one to read in a specific structure. The notion of a general json parser that would produce the ParaSail type declaration automatically sounds like an interesting idea. Python and Javascript are not statically-typed languages, so it is more straightforward for them. But having a tool that could take a json file and generate the ParaSail declarations would make a lot of sense, coupled with a library for ultimately reading the same json file, or a json file using the same pattern. Another good project... ;-)
...
ParaSail does have an "import" but currently it can only import from modules that are included in the set of source files identified on the command line. A directory search path would be an obvious enhancement, and this question will prompt me to give that a higher priority!
2. What is the prefered setup on windows to use csh?I personally use cygwin.
3. Is it possible/how to represent 'heterogeneous dictionaries' like an incomming json object?There is no standard "json" parser, though you could certainly write one to read in a specific structure. The notion of a general json parser that would produce the ParaSail type declaration automatically sounds like an interesting idea. Python and Javascript are not statically-typed languages, so it is more straightforward for them. But having a tool that could take a json file and generate the ParaSail declarations would make a lot of sense, coupled with a library for ultimately reading the same json file, or a json file using the same pattern. Another good project... ;-)I ask because this is kind of bread and butter of current microservices communications practices and I suspect the huge success of Javascript and Python to be strongly coupled to the low friction one has to share 'communication objects'
Given an incoming json object, eg. 'resp' the construction of 'r' is in place, or not. (only data right...)
The mapping for a given encoder (here json and bson, but it can be any other implementation provided) makes the deserialization automatic provided 'sourcing' tags.
type friend struct {
name string `json:"nickname" bson:"nickname"`
}
var r struct {
query []struct {
uid string `json:"id" bson:"id"`
count int `json:"count" bson:"count"`
friends friend[] `json:"friends" bson:"friends"`
} `json:"q" bson:"q"`
}
err = json.Unmarshal(resp.GetJson(), &r)
Note, 'the tagging' gives the opportunity to rename a relation, eg. incoming is 'nickname: "olivier"` will end up, 'name: "olivier' on our side, in r.
Note also that any fields present in the source but not 'tagged' in the receiving struct will be skipped. Quite handy when interested in only a subset of what is comming in.
Eg, when using the youtube api, json objects comming your way are monstruous, they just dump all the information they have about the 'thing' you asked.
This contrasts a lot with languages that requires you to do the mapping 'by hand'.
I think rust has some crates doing something similar.
A parser that generates the type declaration is useful but requires an extra step when dealing with third parties communicating json objects but not providing a reference schema.
Most services just send you data, you inspect it, eg. postman, and code your receiving structures on the spot.
Ok, A+