GithubHelp home page GithubHelp logo

Comments (7)

unitpoint avatar unitpoint commented on July 20, 2024

Hello, thank you for good questions, I'll try to answer.

  1. OS has parser and compiler. The parser splits input text to list of tokens. The compiler uses the tokens to make result opcodes used by OS virtual machine.
  2. The parser doesn't know which purpose it has to expect but the compiler knows. For example "if" token expects boolean expression and body. The body could be started using "{" character. The compiler knows that the "{" character starts number of instructions but not OS object declaration.
  3. It's C++ templates magic. OS binder uses template functions that convert OS arguments to C++.
  4. Use objectscript.h, objectscript.cpp, os-heap.h, os-heap.cpp, os-binder.h to compile OS min version.

from objectscript.

IngwiePhoenix avatar IngwiePhoenix commented on July 20, 2024

I see, thanks for the reply!

So the parser is only the step before the VM, I see. And, what is the „rough“ logic that the VM has to execute things? Sorry that I ask such deep questions, but I am very curios ^^;

Also, how would one teach the parser/vm additional syntax - and how hard is that, too?

And, Im totally going to implement Objectscript into an upcomming project - its jsut too awesome :)
Am So. Feb. 02 2014 21:18:04 schrieb Evgeniy Golovin:

Hello, I'll try to answer all questions.

OS has parser and compiler. The parser splits input text to list of tokens. The compiler uses the tokens to make result opcodes used by OS virtual machine.

The parser doesn't know which purpose it has to expect but the compiler knows. For example "if" token expects boolean expression and body. The body could be started using "{" character.

if(i > 0){ echo "OK" }

The compiler knows that the "{" character contains number of instructions but not OS object declaration.

It's C++ templates magic. OS binder uses template functions that convert OS arguments to C++.

Use objectscript.h, objectscript.cpp, os-heap.h, os-heap.cpp, os-binder.h to compile OS min version.


Reply to this email directly or view it on GitHub.

from objectscript.

unitpoint avatar unitpoint commented on July 20, 2024

Not only, it contains Parser => Compiler => VM. OS::Core::execute() implements main VM logic.

New syntax should be implemented, debugged, tested, optimized, It should not conflict current syntax. So it depends on the new syntax.

from objectscript.

IngwiePhoenix avatar IngwiePhoenix commented on July 20, 2024

Wat, that function is 1249 lines long?! Wow… That’ll take a lot of time untill I can wrap my head around that o-o

BTW. When I try to use

var $meep=“foo“;

I get an error that says that $ is a syntax error…but i saw nothing in the documentation that this way of variable naming was disallowed? o.o
Am Mo. Feb. 03 2014 09:57:58 schrieb Evgeniy Golovin:

Not only, it contains Parser => Compiler => VM. OS::Core::execute() implements main VM logic.

New syntax should be implemented, debugged, tested, optimized, It should not conflict current syntax. So it depends on the new syntax.


Reply to this email directly or view it on GitHub.

from objectscript.

unitpoint avatar unitpoint commented on July 20, 2024

Sorry, $ is reserved for future purposes at the moment.

from objectscript.

unitpoint avatar unitpoint commented on July 20, 2024

$ is not reserved now, you could use it for names of variables or functions

from objectscript.

IngwiePhoenix avatar IngwiePhoenix commented on July 20, 2024

Awesome. I just tested it and made the function I wanted to make. Thanks for the info!

from objectscript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.