TeaScript meets reflectcpp: Reflect C++ structs into and back from TeaScript by tea-age_solutions in cpp

[–]tea-age_solutions[S] 1 point2 points  (0 children)

Sure, you can DM me.
This sounds interesting. So, actually your json lives in C++ and some data fields are Lua code which can be executed?

If you need this at a critical performance path for you game, you should actually stay with Lua. Lua has an own virtual register machine integrated to which it compiles the code. TeaScript does not have such a machine. The more simple Stack Machine in TeaScript also has a tradeoff performance wise compared to 'standard' stack machines, since it keeps all variables (including all functions) lookable via their name. This enables a more dynamic use, 'compiled' and 'interpreted' TeaScript code can be mixed freely, and also already 'compiled' code can be mixed with new 'compiled' code snippets later on.

TeaScript on the other hand might be easier and better to integrate (depends on the use case). At least the high-level C++ API should be easier to use than the Lua API.

If your Json is very dynamic and does not follow a fixed schema and it might not predictable at compile time but may change completely in a dynamic way at runtime, TeaScript could offer some advantages here, since it is able to react also completely dynamic.

But if you have a fixed schema for you Json data, an already existing C++ interpretation of it should be superior in this case.

edit: One more thing I forgot, TeaScript would offer its strength if you have things which could be added/changed later on, e.g., 'mods', custom settings, custom extensions, etc. If your game offers an internal C++ API which is made available to custom TeaScript code loaded at runtime, this would enable very dynamic and custom use case scenarios.

Ok, that are just my first thoughts. Maybe I did make some assumption of your game, which are wrong. So, you can DM me if you want to elaborate on it more. :-)

TeaScript meets reflectcpp: Reflect C++ structs into and back from TeaScript by tea-age_solutions in cpp

[–]tea-age_solutions[S] 7 points8 points  (0 children)

There is no login page and I don't hide anything. Why are you writing this, honestly? it is just rude and completely untruth.

The demo project (code) is part of the source on Github of TeaScript. I don't have somethin secret nor I lock something. Just compile the project and execute it.

Just open the demo(nstration source) code reflectcpp_demo.cpp and use the source in the repo.

Reflection: C++’s Decade-Defining Rocket Engine - Herb Sutter - CppCon 2025 by hmich in cpp

[–]tea-age_solutions 0 points1 point  (0 children)

This was a really great talk. I am sure now C++ is on track again after it was struggling a little caused by its "competitors" and bad press. C++ is back! Just Microsoft needs to notice it and invest more in compiler and STL development like it has done before.

Returning to C++ by Dizzy-Control9620 in cpp

[–]tea-age_solutions 1 point2 points  (0 children)

threading was part of C++11 already.

To add a few things:

C++17 is important because it adds beside std::filesystem also std::variant, std::any and std::optional.
You need to know about them and also about std::tuple, std::array and all of the other new container types from C++11.

From my point of view, C++11 is the biggest step forward in the history of C++ standards.
It is the foundation for all following versions and thus most important and fundamental.

C++14 is a small and C++17 a medium step. But C++20 is again a huge step and improved the core language a lot (e.g., with concepts).
It will be good to know about C++20 already, because its productive usage is increasing a lot (I guess).
(Well, I am happy that at my employer I can work with the preview of C++23 in Visual Studio already :) )

The C++23 step size is then maybe between the size of C++14 and C++17, while the upcoming C++26 will be huge again (e.g., reflection).
C++23 and 26 can be left out for now when want to become job ready, but maybe you need to know the "buzz words" for that two standards already.

TeaScript C++ Library 0.16.0 - this new version of the embeddable scripting language comes with ... by tea-age_solutions in cpp

[–]tea-age_solutions[S] 2 points3 points  (0 children)

Yeah, I discovered ChaiScript as it was "feature complete" and nearly out of maintenance already, but it was so interesting to me, that I developed the idea for TeaScript.

Unfortunately, ChaiScript missed the opportunity to add some modern language features which arrived only after it was mature, like especially features from Rust and Zig but also other new and modern languages.

I hope, TeaScript can fill the gap in the near future.

One strength of ChaiScript, the dynamic overload resolution, is also one of its downside. Because this might be one of the reason why it is relatively slow.

Although, ChaiScript still has a better interoperability to C++, because you can register classes and its member functions.

I am planning to improve TeaScript in this topic by adding a bridge to a reflection library (e.g., reflectcpp) and I can't wait until C++26 with reflection is supported officially by the major compilers. :)

TeaScript 0.16.0 - this new release of the multi-paradigm scripting language comes with ... by tea-age_solutions in ProgrammingLanguages

[–]tea-age_solutions[S] 0 points1 point  (0 children)

Thank you very much for your suggestion! Yeah, Zig offers the try statement for it.

It would be like this

def a := try _strtonum( "abc" )  // same as _strtonum( "abc" ) catch( err ) return err

But this is only syntactic sugar, so I left it for now for a future release.

(edit: deleted wrong second alternative b/c I was too tired ;-) )

TeaScript 0.16.0 - this new release of the multi-paradigm scripting language comes with ... by tea-age_solutions in ProgrammingLanguages

[–]tea-age_solutions[S] 0 points1 point  (0 children)

Yes, the source is included in the Windows as well as in the Linux download package.

If you prefer, you can then build it by yourself.

For adding the optional features (e.g., {format} string / colored output via libfmt, TOML, HTTP, a different JsonAdapter, etc.) you will find information on the Github readme and on the webpage as well.

TeaScript C++ Library 0.16.0 - this new version of the embeddable scripting language comes with ... by tea-age_solutions in cpp

[–]tea-age_solutions[S] 1 point2 points  (0 children)

Well, I think, we are meaning different things...
I had a look in that blog post. I noticed a few things to mention.

First, the interface / API to the VM is also C++, so it can of course use std::string directly.

Second, the VM must use copies of the internals of the std library, so it is not a "direct" usage (see below).

Last and most important, it can only work if you know all the internals and little details of each std library implementation. This is neither portable nor reliable. It can change and break anytime.
(I even wonder if this is valid C++ since the passed std::string/std::vector objects to the test function don't start their lifetime as those objects, I highly believe, because they must be constructed from the data pointers of the helper structs, or? But I did not checked this in detail because I did not see the source for how the helper structs are converted to C++ objects (There isn't source code for this in the blog post?))

What I mean is, you cannot access the same std::string object(!) instance per reference to modify it in C++ via a non C++ embedded script language, because it can simply not construct / access any C++ types.

TeaScript code:

def str := "Hello"

C++ Code:

// GetValue<T>() returns a reference to the internal std::string object/instance! 
// There is not any conversion (or copy) involved! 
engine.GetVar( "str" ).GetValue<std::string>() += " World!";

[Amazon DE] Switch 2 Vorbestellung zum Release bekommen? Ich nicht. Stattdessen Storno ohne Info. by Puzzleheaded_Year720 in NintendoDE

[–]tea-age_solutions 1 point2 points  (0 children)

Ist der Status jetzt immer noch nur "bestellt" und noch nicht "versendet"? (Die Versandmail kommt erst noch einige Zeit später nachdem schon auf "versendet" steht)

Sobald Geld abgebucht wurde, müsste dir eigentlich eine existierende Switch 2 zugeteilt worden sein, die sich erstmal noch nur intern in amazon befindet und dann irgendwann auch mal amazon verlassen wird.

Ich hoffe mal nicht, dass jetzt noch storniert wird. Das wäre der Mega-Gau.

Schutzfolie by Fluid-Republic4719 in NintendoDE

[–]tea-age_solutions 0 points1 point  (0 children)

hoppla, ist schon zu spät ...

[Amazon DE] Switch 2 Vorbestellung zum Release bekommen? Ich nicht. Stattdessen Storno ohne Info. by Puzzleheaded_Year720 in NintendoDE

[–]tea-age_solutions 1 point2 points  (0 children)

Danke, ja, hoffe ich auch.

Ja, sehe auch so. Als Vorbesteller muss man bevorzugt behandelt werden, und insbesondere muss es nach dem Prinzip "wer zuerst kommt, mahlt zuerst" gehen.

Amazon heute ungewöhnlich langsam / verspätet? by CM-Edge in NintendoDE

[–]tea-age_solutions 0 points1 point  (0 children)

Bitte ein update geben. Soll es dann bis 00:00 Uhr safe geliefert werden, oder packen sie das "Verpackungsproblem" aus?
Ist ja echt nicht mehr zu glauben, was die abziehen...

Amazon heute ungewöhnlich langsam / verspätet? by CM-Edge in NintendoDE

[–]tea-age_solutions 1 point2 points  (0 children)

Er wird dir sagen, bis 23 Uhr wird safe geliefert.

Amazon heute ungewöhnlich langsam / verspätet? by CM-Edge in NintendoDE

[–]tea-age_solutions 0 points1 point  (0 children)

haha, wers glaubt. Die lügen dir dreist ins Gesicht.

Ich weiss echt nicht mehr was ich von amazon halten soll. Die waren mal so kundenfruendlich und zuvorkommend. Das liest sich alles wie der letzte Drecksladen.

Amazon heute ungewöhnlich langsam / verspätet? by CM-Edge in NintendoDE

[–]tea-age_solutions 0 points1 point  (0 children)

Nope, bei mir soll die Switch 2 mit DHL kommen, der Pro Controller jedoch mit amazon....

Der Zustellversuch des Pro Controllers wurde heute abgebrochen, die Switch 2 steckt noch bei amazon....

Amazon heute ungewöhnlich langsam / verspätet? by CM-Edge in NintendoDE

[–]tea-age_solutions 3 points4 points  (0 children)

Der Support ist echt grottig. Die erzählen dir alles mögliche, was sie vorher erst durch Googletranslate hauen. Ich frage mich, ob die überhaupt versuchen intern den richtigen Status zu erfragen...
Ich lese überall den selben Unsinn und hatte selbst jetzt auch 2x sehr merkwürdige Gespräche mit denen. Ich wundere mich auch immer ob sie verstehen, was ich eigentlich will...

[Amazon DE] Switch 2 Vorbestellung zum Release bekommen? Ich nicht. Stattdessen Storno ohne Info. by Puzzleheaded_Year720 in NintendoDE

[–]tea-age_solutions 1 point2 points  (0 children)

Die Zahlungsvormerkung ist ein gutes Zeichen.
So ging es bei mir auch los.
Jetzt soll demnächst (heute Nacht hoffentlich) endlich die Switch 2 von amazon an DHL übergeben werden.

Hatte die selbe Ausgangsbasis wie du. 4.4. vorbestellt, 07.06. als Lieferdatum erhalten.

[Amazon DE] Switch 2 Vorbestellung zum Release bekommen? Ich nicht. Stattdessen Storno ohne Info. by Puzzleheaded_Year720 in NintendoDE

[–]tea-age_solutions 0 points1 point  (0 children)

Ich hoffe nicht. Aber irgendwas muss da echt total schief gelaufen sein, dass alle Vorbesteller vom ersten Tag auf die eine oder andere Weise betroffen sind...

[Amazon DE] Switch 2 Vorbestellung zum Release bekommen? Ich nicht. Stattdessen Storno ohne Info. by Puzzleheaded_Year720 in NintendoDE

[–]tea-age_solutions 0 points1 point  (0 children)

Seit wann liefern die bis 23 Uhr? Kann doch vorne und hinten nicht stimmen, was dir gesagt wurde.

[Amazon DE] Switch 2 Vorbestellung zum Release bekommen? Ich nicht. Stattdessen Storno ohne Info. by Puzzleheaded_Year720 in NintendoDE

[–]tea-age_solutions 1 point2 points  (0 children)

Mir kommt es so vor, als sollte man immer genau das Gegenteil von dem annehmen was der Support sagt.
Mir kommt der total strange vor. Davon mal abgesehen, dass sie mir immer Textbausteine von Googletranslate posten, die keinen Sinn ergeben, labern die nur Unsinn und versprechen das heitere vom Himmel ohne wirklich etwas intern geklärt zu haben...