r/ProgrammingLanguages • u/Azereos • Mar 31 '26
Made a toy language (tin)
Hi everyone!
Recently I've started getting a bit more into LLVM and came up with a little programming language called tin. It's not super complete stdlib wise but as far as toy languages go I think its pretty cool (it has a neat type system, traits, cooperative fibers via llvm.coro, etc.). I am still working on a lot of stuff in it (destructive match, stdlib, wasm support, etc.) but I really have been enjoying writing small cli tools for myself. Would love for you all to check it out :)
EDIT: The syntax highlighting is vibe coded as I have never written syntax highlighting plugins and at least wanted some emacs + vscode support. I hope that doesn't count as AI slop as it's just the syntax highlighting đ
3
u/Ifeee001 Apr 01 '26
Pretty solid tbh. I'm getting angsty just going through the docs but that's solely because my brain doesn't function well with white space sensitive languages lol.
Some questions:
https://github.com/Azer0s/tin/blob/main/docs/01-basics.md#null
2. Wouldn't it make more sense for panic to just be a built in function? For consistency reasons I guess. If it looks like a function, it's a function.
https://github.com/Azer0s/tin/blob/main/docs/02-control-flow.md#panic
Or maybe make a keyword instead. E.g.
panic "setup failed"I've been stuck in the "design phase" for like 2 years now so definitely feel free to ignore my suggestions lol
2
u/PitifulTheme411 ... Apr 02 '26
Wow, it seems pretty good. I'm currently designing how macros are going to work in my language and it seems to be quite restrictive. How did you get your macros to be able to return arbitrary, even non-hygenic code (like in your example, the
loopmacro, which outputs invalid code itself, but can be joined by other stuff to be valid)?Also, you allow the language to call macros without the ! if you have the
#no_excltag, but when parsing how does the parser know that it is a function versus a macro call? Also, do you macros support working directly with tokens, or only with preparsed valid expressions or other items as arguments? If so, what's your approach?1
u/Key_River7180 Nain. Apr 04 '26
i like it
0
u/Equal_Debate6439 Mar 31 '26
Esto es un lenguaje de juguete?, dioses tiene un montón de cosas, felicidades!, yo también hago uno desde hace 3 o 4 meses mås o menos es mi primer lenguaje, y me gusto tu array concatenación con ++ talves lo tome!
2
u/[deleted] Apr 01 '26
[removed] â view removed comment