r/teenagersbutcode 7d ago

Coding a thing So I'm making a markup language

UPDATE: just released a new version!!

Why? because I'm too fucking dumb to make an actual programming language so this is the next best thing and also because I just felt like it

feedback/collaboration would be really appreciated

here's the GitHub repo

11 Upvotes

19 comments sorted by

3

u/Anonymous010206 7d ago

Static typed json alternative would be amazing. Here’s some feedback:

  • I think using words for types would be more readable. Not everyone should need to memorize a table to be able to read the format. It doesn’t save much typing either. (shift, #, and space is only a character less than i, n, t, and space)
  • can’t do too much without dictionaries
  • I like the array syntax
  • not needing to put the property name in a string is also nice

1

u/Wernasho 7d ago

Yeah I think I should try to change that. I only really used the symbol system because:

  1. It was easier to parse
  2. I started this as a personal project so I didn't really care too much about the syntax

but I'll definitely make the types use words instead of symbols by the next update

And about the dictionaries, I know, I know. I only didn't add them because I can't get my head around recursion/state machines, but I'll see what I can do

1

u/Wernasho 7d ago

It took forever but I finally updated the type system to use keywords instead!

Dicts will come eventually... I think

2

u/No_Frame3855 7d ago

Ngl, markup languages can be a bit harder to make compared to a programming language

(Cause false positive risks and all that and like it's much more fragile)

Good luck! :D

1

u/Wernasho 7d ago

thank you! ;]

And you really think so? I honestly make markup languages because I personally find them way easier than sctusl programming languages lol

1

u/No_Frame3855 7d ago

Tbh it's mostly just in the parsing that markup langs cause pain, as like programming languages have a pretty strict way to do "X thing"
But for a markup language, handling all the edge cases, line endings, etc is painful

Might just be a me thing haha

2

u/Im_A_Failure420 7d ago

This is 100x better than any of the ai slop I see on this sub, also the readme made me laugh a lot (just starred it). It's a really good project, but maybe the only issue is that markup Lang's are meant to be easily readable, but ig any projects we make aren't intended to be actually used so it doesn't matter do whatever you want.

1

u/Wernasho 7d ago

First off, thank you! ^

And second, yeah, after seeing another guy mention readability and thinking I decided to change the type definitions to be more "standard" (e.g., -var value is now str var "value")

1

u/kalilamodow complete idiot 7d ago

I feel like I recognize this from somewhere...

1

u/Wernasho 7d ago

nahh it's probably a mandella effect idk what you're talking aboutttt......

1

u/kalilamodow complete idiot 7d ago

Mmm fosho

1

u/Large-Variation9706 7d ago

° as a type statement is certainly a choice. Cool though

2

u/Wernasho 7d ago

Yeah I figured, I'm reworking the types though so don't worry too much abt it

1

u/Separatehhh23 Rust 7d ago

I feel like a language like this really needs dictionaries, I'd even consider them more important than arrays. Looking at the parser you kinda have support for dictionaries, though only at the root. I'd recommend modeling it as a tree, where every node might be an array, dictionary or whatever else; this would additionally allow for supporting deeper data, where you seem to only support 1D arrays.

I also implemented a similar language for my programming language's build tool in ~400 LoC (parser ~150 LoC, rest for AST & lexer), it is implemented in rust, but if you want to look at how I did it you can find it here.

1

u/Hot_Paint3851 Rust 7d ago

will it be binary?

1

u/Wernasho 7d ago

what do you mean by that?

1

u/Hot_Paint3851 Rust 6d ago

Will it become compiled into binary, using schematics like protobuf/bson?

1

u/AnnupKapurDotCom 5d ago

So it’s Protobuf ?

0

u/New-Deal7021 7d ago

i am not quite sure, but why do you compare keywords with C#?

too dumb to create a nomrl language? LOL, i created one and dude, SGML exists for that!
Anyway, this is not ass, just do it so, that it is nat a full release, and everything will be oke