This is just a copy paste from this mastodon thread
More docs are here now: https://codeberg.org/pastagang/basil
Cheat sheet here: /blog/basil/docs.html
Posts
#pastagang just soft launched a new hydra language :o #basil

These two are the same semanticaly.

Basil is just a veeeeery thin syntax sugar layer over hydra, its literly being translated into hydra JS code, and then its just normal hydra (or well hydro!) code.
Lots of bugs probably, lots of caveats. no special array syntax (yet?)
in this language # and \n are the same.
(well most of the time; there are places where new lines are ok, but # isn’t)
Both (usually) are the “chaining operator”
so o # r becomes o().r()
arguments, are space delimited
() denote sub-chains (and its the only way to start one, you always need them in add/layer/mod)
<: and :> sourond “javaScript literal”. everything in between will not be modified or parsed. Only way to do dynamic arguments currently.
all aliases are here (currently) https://nudel.cc/basil/basil.js Or see the code here: https://codeberg.org/pastagang/basil/src/branch/main/src/basil.ts
Note that some also reshuffle the arguments!
rs .2 becomes .rotate(0, .2)
I still struggle with a basil-native lambda syntax.
If I try to not parse JS I need a syntax that is invalid in JS, so somthing like:
h (> fft(0,1) <)
(just a bit different from what works currently: <: () => fft(0,1) :> )
But it feels a bit weird. also having to ways of interleaving JS, with slightly different semantics is also not ideal.
Another direction would be to have real native lambdas somehow.
But that means we need to enable expressions such as fft() * 2 + .5
(ignoring the current aliases for * and +), the most native basil solution would be: + (* (fft) 2) .5
A better looking basil solution would probably be fft # * 2 # + 5
We do need to handle this chain completely differently then the other ones though.
Wich is not my favorite thought (normaly this would be transpiled to fft().*(2).+(5)
That is not valid JS, even if we aliases the * & + to mult and add. (but we /could/ patch the number prototype maybe)
(> fft # * .2 # + .2) works now.
That was easier then I thought.
Mostly because I hacked + and * (or rather plus and mult) to be functions on the number prototype in nudel lol

ahh but
(> time # / 10) does not.
it gets translated to () => time().diff(10)
but time isn’t a function 🙃

h (> <:time:> / 10)
weirdly this works.
By accident lol it will be translated to ` () => time.diff(10)`