Skip to content

Releases: louis1001/odo

Release Odo v0.4-beta

24 Jan 00:49
Compare
Choose a tag to compare
Release Odo v0.4-beta Pre-release
Pre-release

v0.4-beta

Jumped the source code to c++20.
This update is a lot.

Optimizations:

  • Removed the ValueTable. Since transforming the values to use smart pointers, there was no need for a value table. The look up involved made the language slower unnecessarily.
  • Replaced std::map with std::unordered_map in the SymbolTable.
  • Removed all error checking related to the SemAn from Interpreter.
  • Optimized the function type creation code.

Bug fixes:

  • Lots of compiler warnings.
  • Added a name for function values so they show up in traceback.
  • RNG was fixed (a couple of times).
  • Fixed the pop function.
  • Fixed casting error in the inheritance interpreting.
  • The unary operator + was being ignored :'(
  • Fixed bug where the type of a variable declaration might only exist after visiting the initialization.
  • Now we check that a class actually inherits from another class and not just any type.
  • Added full support for list type syntax. Now they can appear in function arguments, return types, variable declarations.

New Features:

  • Windows support
  • Semantic Analyzer.
  • Spanish flavored Odo.
  • Added native functions to the language. Bindings between native C++ code and Odo.
  • Values that don't have a string representation now show their actual address in memory instead of the made up one.
  • forange doesn't need a variable name to iterate over anymore.
  • In debug mode, you can now see when exactly was this version of odo compiled.
  • New syntactic sugar for initializing. Direct construction.
  • Started a war against PSeInt. (jk love you guys)
  • Added a push function, which removes the ambiguity in the operator + for lists.
  • Inheritance and OOP are now mostly working. I need to keep testing. (hadn't tested this since refactoring all values).
  • Simplified the function expression syntax. No unnecessary arrows.
  • Added more io related functions to io.h
  • Symbol aliasing in SymbolTable. So that multiple names can refere to the same symbol.
  • Function type aliasing, so that function types can be used as normal types.
  • Replaced the && and || with the actual words. Unneeded legacy code.
  • Renamed the print functions to write. More meaningless legacy code. Write is a lot easier to explain than print.
  • Changed the multi-line comment syntax to be more idiomatic. The use of /**/ didn't make much sense if // was not the default.
  • Added basic support for odo Modules defined in c++. NativeModules allow for a standard library that's organized by names, instead of putting everything into the global scope.
  • Added the native modules math and io to odo.
  • Added the tau mathematical constant.

New demos

  • A mandlebrot set visualizer. (this one got me really excited).
  • A demo that tests out inheritance and polymorphism.

¡Spanish flavored odo!

I'm preparing this version of odo to be used in basic programming classes. This classes are in spanish (I'm from Nicaragua) so I made the my language compatible with my language. :)

In the future I plan on making the IR (intermediate representation) of odo language agnostic so that once parsed, a program from spanish or english can be run by any version of odo.

Semantic Analyzer

The Semantic Analyzer (SemAn) is a core module in Odo. Just like the parser (syntactic analyzer) is in charge of checking that a program is written correctly, the SemAn is in charge of telling if a program makes sense.
This means, checking if the types of operations are compatible (assignment, binary operations, function calls). It also makes sure that every symbol used is valid; that it exists, that is has been defined and that it's usable in that context.
Since the SemAn checks the correctness of a program, the interpreter doesn't need to bother asking a value it's type, or wondering if a variable actually exists. If the SemAn says there's not gonna be any type of those errors, then it should be true.
The addition of this module also means that Odo is finally and truly strongly typed.

Release Odo v0.3-beta

09 Jul 20:47
Compare
Choose a tag to compare
Release Odo v0.3-beta Pre-release
Pre-release

v0.3-beta

This version is full of performance boosts and code improvement.

Optimizations:

  • The parser and interpreter modules now have polymorphism, which makes better use of memory at runtime.
  • Compilation time got longer because the project now has a lot more files to compile.
  • The use of polymorphism on the Value system makes everything run many orders of magnitude faster.
  • Values now store their references as pointers instead of copies of the symbol (no need for uuid generation now).
  • The action of copying Values and converting them to strings was

Bug fixes:

  • CMakeLists had an incorrect command that made the release compiles flag the same as the debug ones.
  • Lists declarations made the assumption that the initial value had to be a ListVal, which broke when trying to read the nonexistent list value.
  • When the forange loop had both bounds and going in reverse, the lower bound was ignored.

New Features:

  • Added functions toAsciiCode and fromAsciiCode. They transform from int to ascii and back.
  • Added sleep function, which adds a timed delay to your code.
  • Repl's about function now tells which compile mode was use to build the program.

New demos

  • BF interpreter

Release Odo v0.2-beta

03 Jul 16:15
Compare
Choose a tag to compare
Release Odo v0.2-beta Pre-release
Pre-release

v0.2-beta

New Logo!
(And the ascii art if you type about() on the repl)

Optimizations:

  • Faster value and symbol lookup
  • Visual optimization of double to string values
  • Symbol identifier now is a int instead of string (faster comparisons)
  • Value now has a pointer to its type instead of taking a copy of its value
  • double to_string conversion now checks if the value is just an integer.

Bug fixes:

  • Any_type pointer was inconsistent/relying on shaky memory.
  • The null value was inconsistent/relying on shaky memory (when assigning its type).
  • For loop wasn't resetting the continuing flag.
  • Function in Value now checks if the value can or should be copied.
  • A comparison with null shouldn't fail because anything can be null.
  • The c++ compiler now warns on every little bug (hopefully).
  • The null value was getting the address 1 by mistake. I should be 0.
  • The use of static statements outside of a class is now an error.
  • lists now copy their contents (if they're copyable) as well as the list_value.
  • Native functions now checks if any of its arguments was already important.
  • Removed unused code.

New Features:

  • typeof function. Returns the type name of the value passed
  • pop function. Deletes the las element from a list and returns it
  • function callstack. Errors now have more meaning! Prints a traceback of the error.
  • valueAt function. This is debug only. Returns a value given an address in the valueTable.
  • foreach and forange statement. This is an improvement over the c-like for.
    The actual loop should have now native speeds.
  • new "last result" variable. In the repl you can now type _ to get the last value returned.