I was about to start working on something (a Minecraft mod, but it can apply to anything else i could do), adding virtual computers and other devices and i need a scripting language for it. Problem is, i'm not finding much aside from Lua and Javascript. I would gladly use JavaScript but not without TypeScript and i'm not sure how to achieve that without bloating the jar (tsgo for example via wasm is about 40mb).
I could also use WASM but the exisiting libraries are either incomplete (no component model, like with Endive) or hard to figure out (literally anything from the ai.tegmentum group. Their docs are all weirdly outdated or wrong).
If i can't find anything, i think i can probably wrap a C# library with a c API and make a library out of it via NativeAOT
#Looking for scripting languages that aren't Lua
56 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
Kotlin script
python
powershell
i mean there are many scripting languages, but if i would want to use one i would probably use python even though i do not like python, but for some scripts it is fine.
what about java ?
I'm not sure how i would do that. I just want something i can sandbox easily
There is nothing you can easily sandbox
except maybe lua
I mean, Endive by default is sandboxed
I mean
if by sandbox you mean safely sandboxed, it is very hard
but if you just want to sandbox, you can just use java
package jshell
Provides interfaces for creating tools, such as a Read-Eval-Print Loop (REPL), which interactively evaluate "snippets" of Java programming language code. Where a "snippet" is a single expression, statement, or declaration. This functionality can be used to enhance tools such as IDEs or can be stand-alone.
JShell is the central class. An instance of JShell holds the evaluation state, which is both the current set of source snippets and the execution state they have produced.
Each source snippet is represented by an instance of a subclass of Snippet. For example, a statement is represented by an instance of
you should never sand code between client and server btw unless you have absolute control over it
I haven't read what the problem with Lua is.
I Just don't like it :)
You know people like you are persecuted today? Lua is a religion, righteously.
Lua might be the best solution since it's pretty much safe
there is also ruby, php, etc. long list
if you use any other language then lua
you should never send code between client and server
Go for php
Yeah, i just hate dynamic typing and a few other quirks it has. Plus i wanna make my thing distinct from ComputerCraft/CC:Tweaked
I must see that
@flat elk
i mean no one forces you to use a scripting language. you can also do the thing you want with a program
do it in java or C#
you could create your own language if you want
I actually considered that
I won't do that.
Tho that was mostly for something else
Use AI that transforms raw text into code ))))
@flat elk please, you have to understand that if you use any language but your own or lua, you simply can't send it between client and server and so your mod will be severaly limited
wasm is pretty safe (when you add limits to it, mostly memory related and interop) but as i wrote i couldn't find many actually usable options, on top of how i can't find many languages to compile to it on the fly
I think some people do use it
Tho mostly in rust and other languages for their games
a lot of language can be interpreted
the problem is just that the language cannot be safely sandboxed
except lua, your own language, and I guess wasm ?
Groovy, you can even make a dsl of the scripting language you want in groovy and still have the bulk be java.
iirc a stretch but if you use WASM then you can sandbox anything that compiles to it
which includes C++, Rust, Java, but not JS (since why bother compiling JS to WASM when your browser already supports JS)
so, it may seem crazy, but why not just a java plugin like althreon said?
just do not accept plugin that use certain api.
the problem is how do you sandbox it
well, it could be a sub process with another jvm,
the communication can be socket or ipc https://en.wikipedia.org/wiki/Inter-process_communication
that sub jvm would load 1 plugin
etc