How much progress have you made since last time? What new ideas have you stumbled upon, what old ideas have you abandoned? What new projects have you started? What are you working on?
Once again, feel free to share anything you’ve been working on, old or new, simple or complex, tiny or huge, whether you want to share and discuss it, or simply brag about it - or just about anything you feel like sharing!
The monthly thread is the place for you to engage /c/programming_languages on things that you might not have wanted to put up a post for - progress, ideas, maybe even a slick new chair you built in your garage. Share your projects and thoughts on others’ ideas, and most importantly, have a great and productive month!
I’m making an engineering language where just about everything is an expression. Lately the most interesting thing to me is the juxtapose operator, i.e. if you stick two expressions next to each other without whitespace, they are considered juxtaposed. Initially juxtapose was just going to be for math/multiplication, but I’ve also decided to make function calling handled via juxtapose as well (since it lets me get rid of several types of syntax and replace them with pure expression handling)
Some interesting examples:
since the quotes delimit the string, you don’t need the parenthesis
printl'Hello, World!'
though sometimes you need to disambiguate with parenthesis
s = "Hello, World!" printl(s)
technically you can wrap either operand, so long as they touch
(printl)s // though this is bad style for function calls
this has a neat consequence that string prefixes are just functions, and work pretty seamlessly
mypath = p"this/is/some/path/object" myregex = re"[^i*&2@]" myphonetics = ipa"ɛt vɔkavit dɛus aɾidam tɛɾam kɔngɾɛgatsiɔnɛskwɛ"
p
,re
, andipa
are all just ordinary functionssome basic math examples
x = 3 y = 2x z = (2+3y)(x*2)
complex numbers/quaternions are pretty seamless
1 + 2i 1 + 2i + 3j + 4k
also physical units will be first class citizens, and fit in pretty nicely with juxtapose
Where it gets really wacky/hard to parse is something like this
sin(x)^2 + cos(x)^2 // => (sin(x))^2 + (cos(x))^2
depending on the types of
sin
andcos
different things can happen. By defaultsin
/cos
are functions, so the function call happens first, but if the user redefined them or constructed an identically formatted expression where they are numeric, then the exponent should happen firsts = 10 c = 20 s(x)^2 + c(x)^2 // => s(x^2) + c(x^2)
but that’s all just a problem for the compiler
Been working on and off on an interpreter/compiler written in python. Pretty slow going though.