13
July 2023 monthly "What are you working on?" thread
(programming.dev)
Hello!
This is the current Lemmy equivalent of https://www.reddit.com/r/ProgrammingLanguages/.
The content and rules are the same here as they are over there. Taken directly from the /r/ProgrammingLanguages overview:
This community is dedicated to the theory, design and implementation of programming languages.
Be nice to each other. Flame wars and rants are not welcomed. Please also put some effort into your post.
This isn't the right place to ask questions such as "What language should I use for X", "what language should I learn", and "what's your favorite language". Such questions should be posted in /c/learn_programming or /c/programming.
This is the right place for posts like the following:
See /r/ProgrammingLanguages for specific examples
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
though sometimes you need to disambiguate with parenthesis
technically you can wrap either operand, so long as they touch
this has a neat consequence that string prefixes are just functions, and work pretty seamlessly
p
,re
, andipa
are all just ordinary functionssome basic math examples
complex numbers/quaternions are pretty seamless
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
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 firstbut 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.