Re: Difficulties with performance in ATS

2018-08-05 Thread Vanessa McHale
Yes indeed! This seems to be as fast as the C code. I can't find any substantial difference, at least. I'll push these changes and take a look at Hongwei's comments next :) Thanks! On 07/20/2018 03:33 AM, Artyom Shalkhakov wrote: > On Friday, July 20, 2018 at 1:22:47 PM UTC+6, Vanessa McH

Re: Difficulties with performance in ATS

2018-08-05 Thread Vanessa McHale
It doesn't seem to affect things in a way that I can measure, though thankfully with Artyom's suggestions the code is now as fast as C (or at least, I can't reliably measure any difference in the two) :) On 07/20/2018 08:39 AM, gmhwxi wrote: >     fun loop2 { i : nat | i > 0 && i <= n+1 } .. (x :

Difficulties writing proofs in ATS

2018-08-11 Thread Vanessa McHale
Hi all, I have been trying to implement proof-level recursion schemes in ATS. My first attempt was the following (it is similar to code here ): absprop FUNCTOR_PROP (A : prop, n : int) absprop BASE_FUNCTOR_PROP (A : prop, B : prop) // TODO: proof-level

Blog post on ATS (and hylomorphisms!)

2018-08-20 Thread Vanessa McHale
Hi all, I finally updated my blog post with an example of how to write a hylomorphism in ATS. I've yet to benchmark it but it's still a pretty nice demonstration of real functional programming in ATS. http://blog.vmchale.com/article/ats-sum -- You received this message because you are

Re: An "I suck at ATS" screencast

2018-08-19 Thread vanessa . mchale
It's pretty hard not to suck at ATS since it requires being good at both functional and systems programming :p I have a lot of experience with Haskell, but not so much strict functional programming (much is the same, however...). But I don't know much C and in either case the compiler kicks my

Re: repl?

2018-10-21 Thread Vanessa McHale
FWIW, I have written ATS2 code that compiles to C which is then wrapped with a Haskell library that GHCi is able to interact with. Have a look here: https://github.com/vmchale/hs-ats/tree/master/fast-arithmetic. You can run cabal new-repl and then λ:> import Numeric.Combinatorics λ:> 400

Re: ATS3: syntax

2018-10-21 Thread Vanessa McHale
You can use pandoc to get manpages, TeX, etc. if you'd like :) On 10/21/18 7:21 PM, Hongwei Xi wrote: > > >> text (simple text files with some formatting, markdown, or AsciiDoc) > > I choose this one: Text + Markdown is what I like most these days :) > > On Sun, Oct 21, 2018 at 8:17 PM Kiwamu

Re: repl?

2018-10-22 Thread Vanessa McHale
This is an aside, but perhaps caching constraint solving and the like would be a good idea? I know Agda will not re-typecheck a module dependency unless it is touched. On 10/22/18 4:05 PM, Brandon Barker wrote: > Seems to be on of the big arguments for using Go. Of course ATS will > (rightly)

Re: ATS3: ATS/Xanadu

2018-10-19 Thread Vanessa McHale
Cross-compilation is in decent shape even with ATS2, at least on Debian. I can cross-compile a program for Raspberry Pi using Debian-provided cross-compilers. I have built binaries for many platforms you can imagine, including Redox https://github.com/vmchale/illiterate/releases As for package

Re: repl?

2018-10-21 Thread Vanessa McHale
I'm not sure how well that would work. Are there any other heavily-ML-style languages with a REPL? I know Haskell has one but its syntax lends itself to such things. Having a JIT would be wonderful (especially if ATS3 is to be a compilation target) but it's outside of my area of expertise. On

Types in ATS2

2018-10-28 Thread Vanessa McHale
Hi all, Is there any literature on types in ATS such as ? >> int? fun ret_zero() : int =   let     fun initize(x : ? >> int) : void =   x := 0     var ret: int     val () = initize(ret)   in     ret   end I know that linear types are well-grounded in linear logic, but I know of no language

Re: Types in ATS2

2018-10-28 Thread Vanessa McHale
e > implementation :) > No longer so confident about working out a theoretical foundation for ATS. > > An interesting idea is often a curse as it forces you to gamble on it. > > > > > > On Sun, Oct 28, 2018 at 4:03 PM Vanessa McHale <mailto:vanessa.mch...@iohk.io&

Re: ATS3: ATS/Xanadu

2018-10-01 Thread Vanessa McHale
subscribe from this group and stop receiving emails from it, send > an email to ats-lang-users+unsubscr...@googlegroups.com > <mailto:ats-lang-users+unsubscr...@googlegroups.com>. > To post to this group, send email to ats-lang-users@googlegroups.com > <mailto:ats-lang-users@googlegroups.com&

Re: Working with views and values

2018-09-03 Thread Vanessa McHale
val >   (pf,fpf|p) = >   ptr_alloc() > in >   !p := x; (pf, fpf | p) > end > > > On Mon, Sep 3, 2018 at 9:15 PM Vanessa McHale <mailto:vanessa.mch...@iohk.io>> wrote: > > Is there any way to implement > > extern > fn {a:vt@ype} as

Working with views and values

2018-09-03 Thread Vanessa McHale
Is there any way to implement extern fn {a:vt@ype} as_view (a) : [ l : addr | l > null ] (a @ l | aptr(l)) extern fn {a:vt@ype} as_value {l:addr} ((a @ l | aptr(l))) : a ? I've tried using view@ and addr@ but it seems they're for stack allocations. I suppose I could write my own view in place

Re: faq

2019-01-12 Thread Vanessa McHale
They don't have much in common really. ATS has linear types, and Rust has affine types. But ATS2 is a research language while Rust hardly even tracks developments in mainstream languages - though it has some nice aspects like a package repository and code formatter. Cheers, Vanessa McHale On 1

Re: Referential transparency in ATS

2019-03-20 Thread Vanessa McHale
I think that might have do with laziness? If you have a side-effecting expression and you try to pretend it's call-by-need, then bad things happen (beta reduction is no longer valid!) Do you have an example in OCaml? I admit I am curious as to why their compiler would do such a thing. On 3/20/19

Re: Important Question for my assignment

2019-03-28 Thread Vanessa McHale
Have a look at https://github.com/trending/ats Cheers, Vanessa McHale On 3/28/19 4:09 AM, Jasmin Aminuddin wrote: > May I know if there is any applications/technologies which are > implemented using ATS? > -- > You received this message because you are subscribed to the Google &

Re: Referential transparency in ATS

2019-03-23 Thread Vanessa McHale
the same result for the same inputs, every time. It turns out that many operations involving reads/writes to memory still satisfy this - and one would like to be able to express that, though I suspect it would be difficult. Cheers, Vanessa McHale On 3/23/19 2:06 PM, Brandon Barker wrote

Writing a lock-free, threadsafe stack (or queue)

2019-02-28 Thread Vanessa McHale
rn match (of ~node_t and ~pointer_t), and in fact this does segfault when I try to use it for parallel directory traversal. Cheers, Vanessa McHale -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop

Re: Writing a lock-free, threadsafe stack (or queue)

2019-03-02 Thread Vanessa McHale
B pops as well; after thread A frees a node, thread B > could try to free it again, resulting in a very > common crash caused by "double-free". > > > On Thu, Feb 28, 2019 at 12:10 PM Vanessa McHale wrote: > > Hi all, > > I've been t

Re: Writing a lock-free, threadsafe stack (or queue)

2019-03-01 Thread Vanessa McHale
um=email_source=footer) > > On Thursday, February 28, 2019 at 12:10:50 PM UTC-5, Vanessa McHale wrote: >> Hi all, >> >> I've been trying to implement a lock-free stack here: >> https://github.com/vmchale/stack. Unfortunately, this is not >> somethi

Stack-allocated arrays in ATS2 (or ATS3?)

2019-02-23 Thread Vanessa McHale
Is there any way to safely use alloca in ATS? I know the language has features for both safe pointer arithmetic and safe use of stack-allocated variables... so it would be nice to both guarantee no out-of-bounds array accesses and no subsequent uses of the pointer. Cheers, Vanessa McHale

Re: Beginner's question: open and close file

2019-03-12 Thread Vanessa McHale
FWIW, I personally would use FILEptr_is_null to check if fptr is null, rather than ptrcast and then a comparison to 0 On 3/12/19 2:22 PM, Hongwei Xi wrote: > Here is a quick fix: > extern > praxi > clear{a:t0ype}(x: INV(a)): void > > fun open_close(): void = > let >   val fptr =

Re: faq

2019-02-04 Thread Vanessa McHale
I have experience coming the other way (Haskell to ATS2), and I think it works well enough - I did pick up some C/low-level programming along the way, and the mailing list has expertise in both areas and can help you. I suspect it will work the same going to other way, though I have a hunch ATS

Re: let/where vs. local

2019-04-13 Thread Vanessa McHale
Maybe I'm missing what you're saying, but with ATS 0.3.12 I think you can only use local...end at the top level Cheers, Vanessa On 4/13/19 5:20 PM, aditya siram wrote: > Am I right in thinking that the difference between a let/where and > local is that the latter allows sharing scope across

Memory-safe graphs without GC in ATS

2019-09-21 Thread Vanessa McHale
Hi all, Is it possible to write memory-safe circular linked list in ATS? Cheers, Vanessa -- 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

Re: Writing a lock-free, threadsafe stack (or queue)

2019-10-25 Thread Vanessa McHale
entation contains a few race conditions. For >> example, say that thread A pops >> and thread B pops as well; after thread A frees a node, thread B could >> try to free it again, resulting in a very >> common crash caused by "double-free". >> >> >

Re: Difficulties with C FFI & writing a concurrent stack

2019-11-19 Thread Vanessa McHale
) = "__cats_some" > > implement none() = None() > implement some(x) = Some(x) > > Frankly speaking, without documentation, I don't feel that ATS2 is ready > for you to do what you wanted here. > > On Mon, Nov 18, 2019 at 10:44 PM Vanessa McHale > wrote: > >>

Re: Difficulties with C FFI & writing a concurrent stack

2019-11-18 Thread Vanessa McHale
;> _) : Option(a) = > "ext#pop_ats" > > should be changed to > > extern > fun pop {a:type}(_t(a) >> _) : Option(a) = "ext#pop_ats" > > On Sunday, November 17, 2019 at 10:16:11 PM UTC-5, Vanessa McHale wrote: >> >> Hi all, >>

Re: simulating typeclasses in ATS

2020-03-25 Thread Vanessa McHale
I wrote about them a little: http://blog.vmchale.com/article/ats-templates (more code https://github.com/vmchale/ats-codecount) They're suitable where typeclasses are as far as I can tell (I am not familiar with the type theory) Cheers, Vanessa McHale On Wednesday, March 18, 2020 at 7:35:29

Re: GPU-accelerated computation in ATS

2020-05-25 Thread Vanessa McHale
only ML language I'm > familiar with that can model IO effects (as linear types, iirc). > > On Tuesday, February 25, 2020 at 8:11:41 AM UTC-5, Vanessa McHale wrote: >> >> Hi all, >> >> I have an example of calling Futhark from ATS: >> https://github.com/vmchale

Constraint solving (integer inequalities)

2021-02-10 Thread Vanessa McHale
didn't find it at first glance). Cheers, Vanessa McHale -- 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.co

Re: Template Debugging Tips?

2021-11-27 Thread Vanessa McHale
I recall getting errors in the generated C code when I forgot to implement some function! (I was able to use them :) http://blog.vmchale.com/article/ats-templates <http://blog.vmchale.com/article/ats-templates> Cheers, Vanessa McHale > On Nov 27, 2021, at 9:05 AM, d4v3y_5c0n

Re: design question

2022-02-08 Thread Vanessa McHale
ssible) would be sort of like a subtype of A(void) or at least you could manipulate it like that. I’m not sure such a solution is worth it though! Might be better to just RTFM :P Cheers, Vanessa McHale > On Feb 8, 2022, at 5:47 PM, Raoul Duke wrote: > > hi, a scenario > > enu