You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm considering creating a new, Java-inspired syntax for Mindcode - code name "jamlog". I see the following benefits of the new syntax:
Current Mindcode syntax was originally derived from Ruby. This language isn't particularly suitable for an mlog compiler, as the mlog limitations call for a statically oriented language. Ruby is, at its core, a dynamic language.
Recent and planned extensions of the language (variable declarations, type system) do not have a suitable counterpart in Ruby. I'm actually modelling them after C/Java convention. That means the current syntax isn't similar to any existing language out there.
Mindcode uses keywords for code block demarcation, which precludes using existing tools to find opening/closing element of a code block. This makes finding missing/redundant end keywords way more difficult.
Mindcode currently doesn't have a good syntax for single-command if statement (a pet peeve of mine).
Having a language similar to Java might make it easier to apply at least some syntax highlighting and/or use tools originally meant for Java.
Note that the goal is not to be able to compile general Java code for mlog. While existing constructs will be matched to Java ones as much as possible, there will be lots of differences compared to Java, including:
Primitive types will be way different from Java's primitive types. There will probably be almost no overlap.
Currently there's only one type - var - but I plan introducing a type system soon.
Case expression will be matched to switch expression (Java 17 feature - the one with ->). There will be no switch statement.
There will be no classes/objects, at least initially. Classes might be eventually added, but they will behave very differently from actual Java classes (specifically, object creation would be static - no new keyword).
Scopes will be, most probably, modeled after C:
Everything outside a function is global.
The entrypoint will be either the void main() function, or a code block ({ code }).
(This will, however, further confuse IDEs and syntax-highlighting tools.)
Assuming I'll decide to go forward with this idea, the following will probably happen:
All existing language features will be supported in the new syntax.
The new syntax will eventually become the main one.
Current Mindcode syntax will become deprecated, but will be supported for considerable time (say, a year).
I'd probably try to implement a tool that would convert the old syntax into the new one automatically.
New features which require changes to the syntax might only be implemented in the new syntax, once it matures.
The project will still be called Mindcode. I might use some different name ("jamlog"?) as a name for the language/compiler, as Mindcode now serves both as the project name (encompassing Schemacode, for example) and the language name.
Please don't hesitate to share your thoughts.
How do you feel about the new syntax?
I prefer the existing syntax, and won't use the proposed new syntax.
0%
I prefer the existing syntax, but I'll switch to the new syntax if necessary.
0%
I have no preference either way.
100%
I'd prefer the new syntax, but I'll use the existing syntax if necessary.
0%
I'm not using Mindcode because I don't like the syntax. I would use if the new sytnax was supported.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm considering creating a new, Java-inspired syntax for Mindcode - code name "jamlog". I see the following benefits of the new syntax:
end
keywords way more difficult.if
statement (a pet peeve of mine).Note that the goal is not to be able to compile general Java code for mlog. While existing constructs will be matched to Java ones as much as possible, there will be lots of differences compared to Java, including:
var
- but I plan introducing a type system soon.->
). There will be no switch statement.new
keyword).void main()
function, or a code block ({ code }
).Assuming I'll decide to go forward with this idea, the following will probably happen:
Please don't hesitate to share your thoughts.
1 vote ·
Beta Was this translation helpful? Give feedback.
All reactions