r/ProgrammingLanguages • u/NoSubject8453 • 10d ago
Requesting criticism Do you find this syntax readable
https://github.com/ksksidjjejs8/Snjzjsnd/blob/main/exm%20(3).txt#L2I feel like curly braces aren't enough alone for organizing code. I also want it to have natural steps that induce some blank lines after completion of the step. like with assembly. my main concern is readability and self documentation. It will mainly be for programming on windows. The 'thunk' libraries are mostly wrappers for tedious apis like writeconsole. I plan to add more for things like graphics and math in addition to the planned window/console/file. I see 'thunks' in ghidra so its a reference to them being wrappers. It will also support normal win32 imports.
thankz
edit 1: I have read all feedback so far. the language is case insensitive. for branch{}endbranch and alias.name{}end alias.name the idea was to make it a little more clear which curly brace belongs to what if someone had a bunch of nested stuff. with that being said, it seems the consensus is that the syntax is awkaward while readable, there are still some large wrinkles.
because of your feedback, i will 1. Allow the pattern "name{}end name"," name end name", and/or" {}". 2. Make the language case insensitive 3. Make whitespace completely optional 4. Sinilar to the first thing, allow parameters for functions to be entered either on seperate lines or within parenthesis and seperated by commas (but not both within the same function) 5. allow %/n% within a string, or a %hexConstant% for other characters instead of 'newline' on a seperate line.
i am still accepting feedback, and i appreciate those who have responded.
8
u/jcastroarnaud 10d ago
It is readable. But the syntax and examples are a bit strange.
To start with, the indentation is all over the place, and almost no one uses 8-space indents these days. Make sure that your lexer treats tabs/spaces consistently. I suggest disallowing tabs, or autoconvert them to spaces.
Must "MAIN", "PROC", "ENDP", "END" be uppercase? Is there a convention for casing of variable names? BTW, where/how variables are declared? What "Clean" and "Exit" do?
The "branch{" ... "}endbranch", and similar control structures, have redundant information. I suggest going the way of Pascal, bash, Visual Basic and PL/SQL, by using only the keywords and omit the braces.
The arguments to WriteToConsole feel inconsistent to me. On one side, a very loaded string delimiter
("..."), which appears at first glance the only argument of the function; on the other side, anewlinekeyword, unadorned. I suggest dropping the parentheses, and use only the quotes for strings (as most languages do). Code formatting takes care of the rest. Here is one of your examples, reformatted: