Re: ATS Dynamic Loading

2016-09-23 Thread gmhwxi
Here is my suggestion:

You can define a datatype as follows:

datatype expr(a: type) = ...

extern
fun
eval_expr{a:type} (e0: expr(a)) -> a

Your compiler needs to have two modes: for compiling to ATS and for
compilng to a value of the type expr(T) for some T.

I used to call expr a guarded recursive datatype, but Haskell people 
nowadays
call it a generalized datatype.

Or simply do

datatype expr = ...

and then use run-time checks to discover type information.

A lisp-like eval cannot be easily added to ATS due to typing complications.

On Friday, September 23, 2016 at 2:55:47 AM UTC-4, aditya siram wrote:
>
> I'm working on a toy Lisp implementation that outputs ATS as a compilation 
> target. It would be convenient if ATS had an `eval`, for instance, `eval("1 
> + 2")` that compiled and loaded on-the-fly.
> -deech
> On Thursday, September 22, 2016 at 6:05:08 PM UTC-5, gmhwxi wrote:
>>
>>
>> Dynload is for the purpose of initializing toplevel
>> name/values bindings.
>>
>> I am not completely clear about what you really need here.
>>
>> An example? A use case?
>>
>> On Thu, Sep 22, 2016 at 4:31 PM, aditya siram  
>> wrote:
>>
>>> Hi, 
>>> I was wondering if ATS supports something like an `eval` function. I 
>>> realize there's a `dynload` for loading a DATS file at runtime but I was 
>>> wondering if this can be extended to arbitrary code.
>>> Thanks!
>>> -deech
>>>
>>> -- 
>>> 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-user...@googlegroups.com.
>>> To post to this group, send email to ats-lan...@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/1a396ee2-3047-4ec6-add2-4f48485b55a1%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>

-- 
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/ae174fd0-f056-45c4-9ee4-a82789136f9c%40googlegroups.com.


Re: ATS Dynamic Loading

2016-09-23 Thread aditya siram
I'm working on a toy Lisp implementation that outputs ATS as a compilation 
target. It would be convenient if ATS had an `eval`, for instance, `eval("1 
+ 2")` that compiled and loaded on-the-fly.
-deech
On Thursday, September 22, 2016 at 6:05:08 PM UTC-5, gmhwxi wrote:
>
>
> Dynload is for the purpose of initializing toplevel
> name/values bindings.
>
> I am not completely clear about what you really need here.
>
> An example? A use case?
>
> On Thu, Sep 22, 2016 at 4:31 PM, aditya siram  > wrote:
>
>> Hi, 
>> I was wondering if ATS supports something like an `eval` function. I 
>> realize there's a `dynload` for loading a DATS file at runtime but I was 
>> wondering if this can be extended to arbitrary code.
>> Thanks!
>> -deech
>>
>> -- 
>> 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-user...@googlegroups.com .
>> To post to this group, send email to ats-lan...@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/1a396ee2-3047-4ec6-add2-4f48485b55a1%40googlegroups.com
>>  
>> 
>> .
>>
>
>

-- 
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/e16f28ba-0990-4529-8ee6-6e3f931805fd%40googlegroups.com.


Re: ATS Dynamic Loading

2016-09-22 Thread Hongwei Xi
Dynload is for the purpose of initializing toplevel
name/values bindings.

I am not completely clear about what you really need here.

An example? A use case?

On Thu, Sep 22, 2016 at 4:31 PM, aditya siram 
wrote:

> Hi,
> I was wondering if ATS supports something like an `eval` function. I
> realize there's a `dynload` for loading a DATS file at runtime but I was
> wondering if this can be extended to arbitrary code.
> Thanks!
> -deech
>
> --
> 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/1a396ee2-3047-4ec6-add2-4f48485b55a1%
> 40googlegroups.com
> 
> .
>

-- 
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/CAPPSPLrBbpFG6%2BQzEjZ_voc4gZfP2N3nkw5OA5a4BfgdvFp7sA%40mail.gmail.com.