objeck / objeck-lang

Objeck is a modern object-oriented programming language with functional features tailored for machine learning. It emphasizes expression, simplicity, portability, and scalability. The programming environment consists of a compiler, virtual machine, REPL shell, and command line debugger with IDE plugins.
https://objeck.org
Other
154 stars 11 forks source link

Add sample code for embedding Objeck in C++ #299

Closed ghost closed 1 year ago

ghost commented 1 year ago

Discussed in https://github.com/objeck/objeck-lang/discussions/298

Originally posted by **iahung2** August 11, 2023 The sample should be able to handle code snippets and a whole source file. I'm very sorry for needing you to spoon-feed me. I'm very bad at coding. Thank you.

Should be part of Getting Started.

objeck commented 1 year ago

I will look into this further.

For now, refer to this. The code is not too complex; however, the build and linking process can be.

ghost commented 1 year ago

I will look into this further.

For now, refer to this. The code is not too complex; however, the build and linking process can be.

It's not for no reason that I asked for sample code. I don't want to be rude, but the API is as obscure as possible. The header lang.h has no comment, and even after I read lang.cpp very carefully, I still have no idea how to use it. Why are there both source on the constructor ObjeckLang and file on the method Compile? Which is the usage for each of them? There is absolutely no comment, no documentation, nothing.

objeck commented 1 year ago

I will create a documented example after I complete the SQLite work.

ghost commented 1 year ago

I'm still looking forward to see the sample code.

objeck commented 1 year ago

Here's an example.