Skip to content

Simplified inter-variable calculations #58

@MatiDragon-YT

Description

@MatiDragon-YT

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...

$x += 1.5
$y -= 2
$x /= 3.1415

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!

$ += @  // ERROR
$ += 12 // ok

and if we change this for this....

var
   @ = 6
   $ = 7
end
$ += @
//EEEEEERROOOOOR!!!!!

Although there are the opcodes for them, which range from 0058 to 0077.
I was wondering if the compiler could extend that small capacity that goes from 0004 to 0046, to have fewer errors when jutar operations like...

$ += $  //nice!
$ += @//good!
@ += @//exelent!
@ += $ //PERFECT!!!

do you think it is possible to add that function?
And do you think that would be cool?

  • It'd be great!
  • First option!

High level

And if you could do long calculations and have the compiler cut them, to analyze which opcode they belong to?
Variables

var
   $321 : float = 0.1
   20@ : float = 2.5
   12@ : float = 46.324
   $482 : float = 3.333
end 

Syntax

calc
   1@ = $321 * 20@ + 12@ / $482 
end

Compilation -->

$321 *= 20@
12@ /= $482 
$321 * = 12@
1@ = $321 // 1@ = 14.1485899

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. 👍

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions