First, you were right, '-DATS_MEMALLOC_LIBC' fixed the code on my end so
that it compiles fine.
Second, it never even occurred to me that Javascript may not use the "main"
function pattern used by C-family languages. With this in mind, it now
makes perfect sense as to why my code didn't work.
If you try to compile to JS, then you cannot have 'main0' in your code.
For instance, the following code worked when I tried:
*datavtype maybe(a:vt@ype) =| NAH of ()| YAH of (a)fn{a:vt@ype} maybe_nah
() : maybe(a) = NAH()fn{a:vt@ype} maybe_yah ( x: a ) : maybe(a) = YAH(x)*
*val () = l
You need the flag '-DATS_MEMALLOC_LIBC'.
On Mon, Nov 29, 2021 at 12:00 PM d4v3y_5c0n3s wrote:
> I tried to compile the above snippet on my local machine, and got the
> following error:
> /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld:
> /tmp/ccVVVRVe.o:metap_test_dat:(.tex
I tried to compile the above snippet on my local machine, and got the
following error:
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/bin/ld:
/tmp/ccVVVRVe.o:metap_test_dat:(.text+0x12a): undefined reference to
`atsruntime_mfree_undef'
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../
You need to select the "Patsopt2js" button when using Try-ATS-on-line to
get the error I posted. I'll test using my local ATS installation to
determine whether this is only on the JS version of ATS or not.
On Monday, November 29, 2021 at 10:23:56 AM UTC-5 gmhwxi wrote:
> Is there a way for me t
Is there a way for me to generate the error you are referring to?
The above code works fine on my end.
--Hongwei
On Mon, Nov 29, 2021 at 10:16 AM d4v3y_5c0n3s wrote:
> I think I've been able to break down a problem I've been having with ATS'
> templates into a simple example provided below. T