Here is the quintessential guessing game as implemented in ATS. The SATS file (the public external specification) and the DATS file (the implementation): and finally, the Makefile: Running it:| Talking with a Lisp
I had presented a functional merge sort implementation in a previous blog. Here is an example of a functional implementation of insertion sort in ATS: Running it:| Talking with a Lisp
The very first language that I ever learnt in my life was LOGO all the way back in the third grade (year/standard). I immediately fell in love with it, and I would eagerly wait forthe lab to open so that I could try out all the pictures that I had in mind – houses, spirals, … Continue reading A guessing game implementation in LOGO| Talking with a Lisp
Monadic parsing is a form of parsing that combines lexing, parsing, and often evaluation in the same recursive process. Languages with strong algebraic data types (andthereby good pattern-matching) are excellent candidates for monadic parsing. Interestingly, Rust has a popular parser-combinator library called nom, but using it is not as clean as in ML-like languages due … Continue reading A simple Monadic Parser Combinator library in Idris| Talking with a Lisp
I thought it would be an interesting experiment to compare the generation of primes, lazily, in both Haskell and Idris. Haskell has lazy evaluation by default, and Idris does support it via the Lazy and Force primitives, and infinite data structuresusing Streams etc. Here is the code in Haskell (adapted from Graham Hutton’s book, “Programming … Continue reading Lazy primes in Idris| Talking with a Lisp
I had tried Idris some time back, and while I liked it, I didn’t follow through with it. One major reason was the fact that Idris’ focus appeared to be purely on research despitemarketing itself as a language for programmers. There is a bit of contradiction in that statement. Of late, however, especially with the … Continue reading Basic Matrix operations in Idris| Talking with a Lisp
The more I learn of ATS, the more I’m fascinated by it. Notwithstanding the talk which pokes sufficient (light-hearted) fun at ATS, I actually find it very logical, including the naming and organisation of files, libraries, and concepts.After the initial get-go, it’s been a veritable pleasure learning ATS. I’m halfway through the first book, and … Continue reading A simple file copying example in ATS| Talking with a Lisp
This is an implementation, in ATS, of one of my favourite exercises in closures – a line-number printing closure. For reference, the Rust version is given first, and then the same in ATS, whih has a unique flavour of its own. Here is the Rust version: Running it: And here is the same in ATS: … Continue reading A line number closure implementation in ATS| Talking with a Lisp
A simple, functional merge sort implementation for a custom list type in ATS: Testing it out:| Talking with a Lisp
The more I learn ATS, the more I love it. Never mind the naysayers and the detractors who claim it is an illogically complex language. So far, I’ve found it to be a verylogical and relatively…| Talking with a Lisp