Re: libatscc: packaging

2019-05-06 Thread M88

Somewhat related:  maybe it would be good to have some character-sequence 
that represents a module accessor in the host language?

For example, something like "mac#Math**sqrt" could be translated to 
"Math.sqrt" by atscc2[x], depending on what the module system uses for 
namespaces.

>From an implementation standpoint, the accessor notatiion might be a rather* 
bad* idea ( we'd be converting functions named "Math_052__052_sqrt" to 
"Math.sqrt" ).  Still, maybe there
are ways to make it better.

Beyond making FFI easier, we'd also be able to package the prelude as a 
module in the host language, which may have benefits (integration, 
bundling, tree-shaking, etc) over
methods like concatenation.  

Just a thought

A while ago, I had attempted to add [es6, commonjs, IIFE, UMD] module 
support to atscc2js.  Though it worked with a single file, I decided it had 
little benefit over inline code blocks if there is no [easy] way to access 
functions from the generated modules. 


On Monday, April 1, 2019 at 6:46:44 AM UTC-4, Artyom Shalkhakov wrote:
>
> Hi all,
>
> I've started work on improving atscc2js yesterday and found that we have 
> three similar projects:
>
>1. https://github.com/steinwaywhw/ATS-Python3
>2. https://github.com/bakpakin/ats-lua
>3. https://github.com/sazl/ats-go
>4. and the in-progress atscc2js
>
> Every target programming language comes with its own "prelude" (e.g. 
> libatscc2js for JS), but such preludes essentially implement the interfaces 
> defined in libatscc.
>
> Now I'm thinking that we need to package up the interface and keep it as 
> uniform as possible across the different targets, so that programmers may 
> hopefully share more code between platforms with little issues (or no issue 
> at all).
>
> With the above in mind, I propose to:
>
>1. package up libatscc somehow, e.g. put it on NPM (I'm working on 
>this, it will require only minimal changes to the existing code)
>2. come up with some process to maintain this 'specification' (maybe 
>create a github organization and put this library into a repository; let 
>people use issues and PRs to propose changes)
>
> Is anybody interested? If not I'll just go with the first point, and the 
> specification will live on in the ATS-Postiats repository (for now).
>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/2efe4f1e-9558-4176-a538-f5fb6d475a83%40googlegroups.com.


Re: libatscc: packaging

2019-05-06 Thread Richard
Sounds like a good idea to me!

On Monday, April 1, 2019 at 6:46:44 AM UTC-4, Artyom Shalkhakov wrote:
>
> Hi all,
>
> I've started work on improving atscc2js yesterday and found that we have 
> three similar projects:
>
>1. https://github.com/steinwaywhw/ATS-Python3
>2. https://github.com/bakpakin/ats-lua
>3. https://github.com/sazl/ats-go
>4. and the in-progress atscc2js
>
> Every target programming language comes with its own "prelude" (e.g. 
> libatscc2js for JS), but such preludes essentially implement the interfaces 
> defined in libatscc.
>
> Now I'm thinking that we need to package up the interface and keep it as 
> uniform as possible across the different targets, so that programmers may 
> hopefully share more code between platforms with little issues (or no issue 
> at all).
>
> With the above in mind, I propose to:
>
>1. package up libatscc somehow, e.g. put it on NPM (I'm working on 
>this, it will require only minimal changes to the existing code)
>2. come up with some process to maintain this 'specification' (maybe 
>create a github organization and put this library into a repository; let 
>people use issues and PRs to propose changes)
>
> Is anybody interested? If not I'll just go with the first point, and the 
> specification will live on in the ATS-Postiats repository (for now).
>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/7e30cb96-4956-4ca7-af48-f0ad49726b3c%40googlegroups.com.


Re: Effectless ffi

2019-05-06 Thread Richard
Oops, did not see you responded Artyom!

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/10e6f90a-fb2f-42e7-81d1-6032a798f107%40googlegroups.com.


Re: Effectless ffi

2019-05-06 Thread Richard

>
>
> I do understand, that this is due to goal to make transition from C to ATS 
> to be less painful, but maybe, there should be some flag (like -XSafe for 
> ghc, or maybe -Wall -Werror), which will treat effectless ffi calls to be 
> compile time errors?
>

Annotating a function definition with effects can be seen as a 
programmer-centric way to provide the typechecker with extra information 
about a functions apparent purity, most often seen in combination with 
proof functions. Also, effects-tracking is most useful when the 
characteristic behavior of a function is known to the programmer.

And one more generic question: I haven't got if user can introduce new 
> custom effects or are they just a predefined set of effects? Are there any 
> docs about such topics in ATS?
>

Only builtin effects are currently supported. Here is some information on 
the builtin effects, https://github.com/githwxi/ATS-Postiats/wiki/effects
 

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/6644ffad-e2dd-4915-abc6-7491d40ccb45%40googlegroups.com.


Re: Effectless ffi

2019-05-06 Thread Artyom Shalkhakov
Hi Alexander,

пн, 6 мая 2019 г. в 07:16, Dambaev Alexander :

> We can define external call as effectless (as I understand, this means
> "pure" in terns of ATS2);
>
> extern fn sqrt( double) :<> double = "ext#"
> extern fn launch_missles( double) :<> double = "ext#"
>
>
> I do understand, that this is due to goal to make transition from C to ATS
> to be less painful, but maybe, there should be some flag (like -XSafe for
> ghc, or maybe -Wall -Werror), which will treat effectless ffi calls to be
> compile time errors?
>
>
Effect annotations are used in ATS for a different reason (compared to
Haskell). Please see HX explaining it here:

https://groups.google.com/d/msg/ats-lang-users/L38Bzie5lsE/OnI1BXq8HoIJ


> And one more generic question: I haven't got if user can introduce new
> custom effects or are they just a predefined set of effects? Are there any
> docs about such topics in ATS?
>

We have some docs in the wiki, please see:

https://github.com/githwxi/ATS-Postiats/wiki/effects

-- 
> You received this message because you are subscribed to the Google Groups
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ats-lang-users+unsubscr...@googlegroups.com.
> To post to this group, send email to ats-lang-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ats-lang-users/c440ad8c-9322-44ca-ba6e-c3aaeabe0ece%40googlegroups.com
> 
> .
>


-- 
Cheers,
Artyom Shalkhakov

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAKO6%3DqhipLEPSW4YoW566RVQN4AwxTZJN45cx8hwpcFB61Foqg%40mail.gmail.com.