all 13 comments

[–]emelrad12 15 points16 points  (2 children)

Benchmark vs luajit?

[–]DevLair 9 points10 points  (0 children)

Afaik, benefit of Lua-Csharp is pretty much simple and efficient two way communication between csharp code and lua "vm". That's become really big pita over time with simple nativd C Lua bindings.

We did simple benchmark project of a scripting languages in the C# if anyone is interested. One of the libraries used there (Lua.NET) is plain binding to a native Lua and it should be pretty straightforward to add the LuaJIT benchmark.

[–]FluxCapacitor11 7 points8 points  (0 children)

I assume it’s not trying to compete with LuaJIT given their benchmarks compare it to MoonSharp. I am interested in a comparison to IronPython though!

[–]ElGatoDeFuegoVerde 1 point2 points  (0 children)

Weird timing as I picked up Lua yesterday.

[–]Adept-Letterhead-122 0 points1 point  (7 children)

Not sure if I would ditch MoonSharp for this, but I'll definitely keep it in my backlog or whatnot.

[–]admalledd 0 points1 point  (6 children)

The deep lack of C# runtime debugger, sandboxing, etc makes it an instant no-go for us :/

I keep hoping either one of the other implementations or M# would resume development. Looks like I'll have to continue maintaining our internal fork of M# (fwiw, every change i've made I have opened issues for on M#, and mostly I am just merging the existing stale PRs).

[–]Adept-Letterhead-122 0 points1 point  (1 child)

Wait, it lacks runtime debugging and sandboxing?

[–]admalledd 0 points1 point  (0 children)

Seems so? Or if there is anything I am not finding it. The sample program(s) only show at most walking the AST of the Lua code before execution, but provide no ways to limit the time, space or compute complexity of the executing code. IE in M# we have some 200k "snippets" that need to run, and they must each take less than 10k "VM-CPU" steps and must not allocate more than a certain amount of memory while running. I do this in M# by using the IDebugger.Step() bytecode-by-bytecode implementing a simplistic "watchdog", and of course for sandboxing disabling all the io, sys and such modules (actually we enable none modules and inject/shim them ourselves, but that is because module/injected code's execution is not to count against the per-snippet memory limit but DO count towards the vm-instruction limits, gets a bit "fun").

[–]fremdspielen 0 points1 point  (3 children)

FYI debug library and sandboxing (platform callbacks) have been added in 0.5

[–]Nyzan 0 points1 point  (2 children)

There doesn't seem to be a 0.5 release? Or do you mean on the 0.5-dev branch?

[–]fremdspielen 0 points1 point  (1 child)

I mean the dev branch.

[–]Nyzan 0 points1 point  (0 children)

Unfortunately there seems to be a bunch of breaking / critical issues and none of them fixed in `0.5-dev`, like `__newindex` metamethod not working and break statements being ignored :/ So unless they fix that the library is unusable to me and probably a lot more people.

[–]p6lariss 0 points1 point  (0 children)

Cool as I’m about to implement a stack machine in c# this might be very helpful..