-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplified inter-variable calculations #58
Comments
this works, compiles to 005E. complex expressions are fine and easy to implement until we got to the point where we need to introduce a temporary variable to calculate the result. consider:
this should unwrap to:
which is again possible to implement but requires extra memory managements. Due to limits on variables the compiler can't arbitrarily add more hidden variables (neither global, as it affects the main.scm layout by increasing varspace in the header, nor local as their amount is very low). Here is the dilemma, how to circumvent it. |
custom local variables #32 is actually a one step closer towards supporting features like this as we hide some low-level details from the user and let the compiler deal with variables under the hood. |
You are absolutely right @x87 , in fact the IDE compiles those opcodes well ..... Unless ..... heheheeee....... use variables from the constants.txt file... hohohoo~ 😱 is this a compiler error, or a programmer error? (me) |
@MatiDragon-YT I see. You can't use constants defined in
although I think sometimes the compiler could infer the type from the value that has been assigned to it (0.5 means float), but Sanny is not that smart yet. |
uhmm... oh, okay... and thank you very much for your attention to my questions. |
These opcodes that you implemented in CLEO2 could be supported
so they can be used like this
|
this has been implemented in v3.6. now in statements like
|
Hello, good afternoon colleagues.
Let's talk about a low level first.
Low level
As you already know, the compiler supports low-level arithmetic operations like...
which save us some time searching for the opcode.
If you are like me, surely you quickly realized that these shortcuts only work to assign a static value, NOT VARIABLES!
and if we change this for this....
Although there are the opcodes for them, which range from
0058
to0077
.I was wondering if the compiler could extend that small capacity that goes from
0004
to0046
, to have fewer errors when jutar operations like...do you think it is possible to add that function?
And do you think that would be cool?
High level
And if you could do long calculations and have the compiler cut them, to analyze which opcode they belong to?
Variables
Syntax
Compilation -->
Well, I don't know what language you use, but previously, at the university, they had told me to do something similar in C #, and I remember that it was done with System.Text.RegularExpressions. Also in JavaScript .... It is easy, but somewhat confusing the system, but it would be somewhat satisfactory if the IDE already has it by default, so as not to have to use an app that hosts on the internet... haha
Mi inglés es terrible, pero espero que lo entiendas todo. 👍
The text was updated successfully, but these errors were encountered: