HN user

timdeve

43 karma

https://github.com/TimDeve

Posts0
Comments31
View on HN
No posts found.

This is really lovely.

Would be great as an inspiration tool if it would make a little visualisation of the notes/accent/slides on a piano roll.

I can read the JSON meanwhile but just an idea.

The goal is certainly to have a language suitable for "real-time applications" (read games/audio), that's not my area of expertise however so your definition of real-time might not be different than mine.

As it compiles to C, any microcontroller with a compiler that supports something that looks like C can work. I've run Carp code on a GBA (as mentionned somewhere else in the comments), esp32, esp8266, as well as Arduboy & Pygamer via Arduino.

There is some more information about running Carp on embedded platforms in the docs[0].

One last thing I wanted to mention is that Carp is still very much in flux so it might not be the best choice for longterm projects, but if you're interested in playing with the language there is usually always someone to answer questions on the Gitter[1].

[0] https://github.com/carp-lang/Carp/blob/master/docs/Embedded....

[1] https://app.gitter.im/#/room/#eriksvedang_Carp:gitter.im

Don't get too hung up on the "lisp" in that title. I think the language would better be described as statically typed, with s-expr syntax, inspired by Clojure|Rust|ML and with a lispy language accessible for use in macros. But that's less catchy.

Source: I contribute to the language.

Carp is statically-typed with type inference so writing (the Int x) would be enough for the compiler to forbid any usage of x as another type. Writing (Int.+ x 1) would accomplish the same as Int.+ only accepts Int.

You can also annotate function with a type signature.

  (sig add (Fn [Int Int] Int))
  (defn add [x y] (+ x y)) 
Is the same as:
  (defn add [x y] (the Int (+ (the Int x) (the Int y))))

Yes, exactly, it's because of Structural Typing that you have to implement Phantom Types in that hacky way rather than Structural Typing being the "trick".

I've been having tons of fun lately making GBA games, it's far enough from my webdev day job to be intellectually stimulating. I'm quite impressed with people saying they use to built games when 12, some of the stuff in tonc took a bit to click for me.

I definitely recommend Aseprite for pixel art, it's really good.

Love Carp, the fact that it compiles to C means it can run everywhere like embedded (GBA[1], ATSAMD51[2], esp8266[3]) but is also expressive enough that you could build web apps with it[4].

It's very pre-v1 though so expect breakage and API change.

[1] https://github.com/TimDeve/dino/blob/master/main.carp

[2] https://github.com/TimDeve/carpgamer/blob/master/main.carp

[3] https://github.com/TimDeve/carp-lang-arduino/blob/master/mai...

[4] https://github.com/TimDeve/koi/blob/master/examples/notes-js...