Re: Packaging ats3d

2017-04-27 Thread gmhwxi

I made some changes here:

https://github.com/githwxi/ATS-Postiats-frozen/tree/master/projects/SMALL/atscntrb-as-ats3d-2017-04-27

#

First, please change

staload "../some-path"

to

staload "./../some-path"

The first '.' means the directory in which the file containing 'staload 
"./../some-path"
is located.

I also added: mylibies.hats and mylibies_link.dats. The latter is for 
generating code
needed  at link-time.

Various occurrences of "../CATS/vector.cats" are changed into

"atscntrb-as-ats3d/src/CATS/vector.cats"

#

On Thursday, April 27, 2017 at 11:58:44 AM UTC-4, Artyom Shalkhakov wrote:
>
> On Thursday, April 27, 2017 at 9:45:40 PM UTC+6, gmhwxi wrote:
>>
>> Thanks!
>>
>> Just tried it:
>>
>> /home/ubuntu/workspace/mytmp/node_modules/atscntrb-as-ats3d/src/DATS/quaternion.dats:
>>  
>> 7079(line=343, offs=11) -- 7093(line=343, offs=25): error(3): the symbol 
>> [.length] cannot be resolved due to too many matches:
>> D2ITMcst(length_vec3i) of 10
>> D2ITMcst(length_vec3f) of 10
>>
>>
> Well, this isn't supported yet, sorry! I'm going to give quaternions a try 
> once a proper scene description is done. I'm currently working on test04 
> (will break it into separate modules soon); the goal is to create a 
> feature-rich software rasterizer that mimics the OpenGL shading pipeline 
> (I'm following https://github.com/ssloy/tinyrender as an inspiration).
>  
>
>> It seems that a type-annotation is needed for the if-expression.
>>
>> Also, there are files like xyz~ in the package. You may want to remove 
>> them.
>>
>>
> This is what I was trying to avoid. But maybe it's there because it got 
> into version control... We'll see.
>  
>
>>
>> On Thursday, April 27, 2017 at 11:33:53 AM UTC-4, Artyom Shalkhakov wrote:
>>>
>>> I made this package:
>>>
>>> https://www.npmjs.com/package/atscntrb-as-ats3d
>>>
>>> This is what I did:
>>>
>>> $ cd ats3d
>>> $ npm init
>>> ...answered some questions (most notably, named the package 
>>> [atscntrb-]; added ATS to the list of keywords)
>>> ...tried to figure out how .npmignore work (it didn't help me exclude a 
>>> leftover README.md~ file, no idea why)
>>> $ npm publish
>>>
>>> That was very simple!
>>>
>>> What are the mylibies/mydepies files? I'm still struggling to understand 
>>> how external package dependencies are handled.
>>>
>>> On Thursday, April 27, 2017 at 6:13:15 PM UTC+6, gmhwxi wrote:

 Sure :)

 On Thursday, April 27, 2017 at 2:56:23 AM UTC-4, Artyom Shalkhakov 
 wrote:
>
> On Thursday, April 27, 2017 at 12:17:02 PM UTC+6, gmhwxi wrote:
>>
>>
>> Packaging ATS code is largely undocumented at this point.
>>
>> I suggest that we use ats3d (https://github.com/ashalkhakov/ats3d)
>> as a concrete example to illustrate some key steps involved in forming
>> an npm-package for ATS code.
>>
>
> I'll do it, will you wait for evening? Oh, I wanted to say: will you 
> wait for 6 hours?
>
> I guess at this point, just creating a dummy package with sources will 
> be enough? I have packaged some tiny library on NPM once.
>


-- 
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/43d61c91-6609-4a14-ba2e-25b81f1faed0%40googlegroups.com.


Re: [atspre_malloc_gc] on Arduino

2017-04-27 Thread August Alm
No luck unfortunately. 
Adding 
#include "prelude/CATS/memory.cats"
doesn't help either (it was the trick that did it in an old thread on this 
list).

Den fredag 28 april 2017 kl. 00:57:35 UTC+2 skrev gmhwxi:
> Plz try it. It may solve ur problem.
> 
> 
> Sent from my T-Mobile 4G LTE device
> 
> 
> 
> 
> 
> 
> 
> -- Original message--
> From: August Alm
> Date: Thu, Apr 27, 2017 5:53 PM
> To: ats-lang-users;
> Subject:[atspre_malloc_gc] on Arduino
> 
> 
> Hi!
> I am fiddling around with using ATS for Arduino, based on the ATS-contrib 
> folder.
> Lots of fun! The following error, though, leaves me clueless as to how to 
> fix: 
> 
>  In function ‘void* ATSLIB_056_prelude__array_ptr_alloc__46__1(atstype_size)’:
>  ... error: ‘atspre_malloc_gc’ was not declared in this scope
> 
> At least one of the examples in the contrib folder (the Queens puzzle 2, I 
> think),
> contains:
> 
>  %{^
>  #define ATS_MFREE free
>  #define ATS_MALLOC malloc
>  %}
> 
> That does not help with the [atspre_malloc_gc], but is it something similar 
> that must
> be added to my file to make it compile?
> 
> Best wishes,
> August
> 
> -- 
> 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/b10f1899-9196-498b-9645-25270feda8d3%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/46b49e80-6c25-4a1d-a3a7-39b2435391e2%40googlegroups.com.


[atspre_malloc_gc] on Arduino

2017-04-27 Thread August Alm
Hi!
I am fiddling around with using ATS for Arduino, based on the ATS-contrib 
folder.
Lots of fun! The following error, though, leaves me clueless as to how to 
fix: 

 In function ‘void* 
ATSLIB_056_prelude__array_ptr_alloc__46__1(atstype_size)’:
 ... error: ‘atspre_malloc_gc’ was not declared in this scope

At least one of the examples in the contrib folder (the Queens puzzle 2, I 
think),
contains:

 %{^
 #define ATS_MFREE free
 #define ATS_MALLOC malloc
 %}

That does not help with the [atspre_malloc_gc], but is it something similar 
that must
be added to my file to make it compile?

Best wishes,
August

-- 
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/b10f1899-9196-498b-9645-25270feda8d3%40googlegroups.com.


Re: Packaging ats3d

2017-04-27 Thread Artyom Shalkhakov
I made this package:

https://www.npmjs.com/package/atscntrb-as-ats3d

This is what I did:

$ cd ats3d
$ npm init
...answered some questions (most notably, named the package 
[atscntrb-]; added ATS to the list of keywords)
...tried to figure out how .npmignore work (it didn't help me exclude a 
leftover README.md~ file, no idea why)
$ npm publish

That was very simple!

What are the mylibies/mydepies files? I'm still struggling to understand 
how external package dependencies are handled.

On Thursday, April 27, 2017 at 6:13:15 PM UTC+6, gmhwxi wrote:
>
> Sure :)
>
> On Thursday, April 27, 2017 at 2:56:23 AM UTC-4, Artyom Shalkhakov wrote:
>>
>> On Thursday, April 27, 2017 at 12:17:02 PM UTC+6, gmhwxi wrote:
>>>
>>>
>>> Packaging ATS code is largely undocumented at this point.
>>>
>>> I suggest that we use ats3d (https://github.com/ashalkhakov/ats3d)
>>> as a concrete example to illustrate some key steps involved in forming
>>> an npm-package for ATS code.
>>>
>>
>> I'll do it, will you wait for evening? Oh, I wanted to say: will you wait 
>> for 6 hours?
>>
>> I guess at this point, just creating a dummy package with sources will be 
>> enough? I have packaged some tiny library on NPM once.
>>
>

-- 
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/5540fe0a-a519-40ba-815a-56587b885c3b%40googlegroups.com.


Re: Indentation

2017-04-27 Thread Hongwei Xi
I guess I am guilt of it.

I may have some sort of psychological aversion to indentation :)
I tend to use comments to indicate the beginning and ending of a
block.

Just want to say a few words on coding style before closing the message:

I like type-annotation a lot.

Using parentheses around an expression
and then adding a type-annotation is a very good style to me. See:

val =
(
case+ ... of
| ...
| ...
) : some-type

Also, run-time checks work really great:

val () = assertloc(...)

I tend to spread such run-time checks in my code (when I feel proving is
a bit too expensive for the moment).

On Thu, Apr 27, 2017 at 9:34 AM, Shivkumar Chandrasekaran <00s...@gmail.com>
wrote:

> I have noticed that ATS code posted here is no longer indented making it
> impossible to find where a block begins and ends. Am I missing something?
> May be a special editor mode? Thanks. --shiv--
>
> --
> 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/81b5be89-c321-4440-ba46-20bc82ea7178%
> 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/CAPPSPLrp0kz027ChQqtqWs5rv_VSgKLXQD58g7Jqk_s374YYPw%40mail.gmail.com.


Indentation

2017-04-27 Thread Shivkumar Chandrasekaran
I have noticed that ATS code posted here is no longer indented making it 
impossible to find where a block begins and ends. Am I missing something? 
May be a special editor mode? Thanks. --shiv--

-- 
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/81b5be89-c321-4440-ba46-20bc82ea7178%40googlegroups.com.


Re: Packaging ats3d

2017-04-27 Thread Artyom Shalkhakov
On Thursday, April 27, 2017 at 12:17:02 PM UTC+6, gmhwxi wrote:
>
>
> Packaging ATS code is largely undocumented at this point.
>
> I suggest that we use ats3d (https://github.com/ashalkhakov/ats3d)
> as a concrete example to illustrate some key steps involved in forming
> an npm-package for ATS code.
>

I'll do it, will you wait for evening? Oh, I wanted to say: will you wait 
for 6 hours?

I guess at this point, just creating a dummy package with sources will be 
enough? I have packaged some tiny library on NPM once.

-- 
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/c81d7933-abc7-43a9-b970-b126e1a288d3%40googlegroups.com.