Hello! First I want to thank all involved in making love2d and all those who are helping people here on the forums. Also, please excuse my English.
My question is is it possible to use luajit command-line parameters with love, like -jv and -jdump to see where my code is falling out of compiler, and -jp for profiler when (and if) luajit 2.1 will be implemented in love? I tried the obvious, adding them (-jv and -jdump) as switches to love.exe, that did nothing.
If not possible, isn't it worth considering to include in love?
I am really bad at this stuff, so I gave up with existing profilers, but I want to see if I could handle these built-in luajit thingies.
Luajit command line options (-jv, -jdump, -jp)
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Luajit command line options (-jv, -jdump, -jp)
I think you can require("love") from other Lua environments, so you could start luajit with -jv and give that a go.
Re: Luajit command line options (-jv, -jdump, -jp)
Ummm... no you can't. LOVE isn't not a lua library. The difference is that LOVE initializes lua internally while a library is passed an already existing lua state.S0lll0s wrote:I think you can require("love") from other Lua environments, so you could start luajit with -jv and give that a go.
I suggest that you modify and compile LOVE yourself so that it will do this.Dmitr wrote:Hello! First I want to thank all involved in making love2d and all those who are helping people here on the forums. Also, please excuse my English.
My question is is it possible to use luajit command-line parameters with love, like -jv and -jdump to see where my code is falling out of compiler, and -jp for profiler when (and if) luajit 2.1 will be implemented in love? I tried the obvious, adding them (-jv and -jdump) as switches to love.exe, that did nothing.
If not possible, isn't it worth considering to include in love?
I am really bad at this stuff, so I gave up with existing profilers, but I want to see if I could handle these built-in luajit thingies.
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Re: Luajit command line options (-jv, -jdump, -jp)
Yes, you can. Try getting a terminal, navigating to LÖVE's folder, running LuaJIT and requiring "love" and see what happens.I~=Spam wrote:Ummm... no you can't. LOVE isn't not a lua library. The difference is that LOVE initializes lua internally while a library is passed an already existing lua state.
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- slime
- Solid Snayke
- Posts: 3172
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Luajit command line options (-jv, -jdump, -jp)
You can, actually!I~=Spam wrote:Ummm... no you can't. LOVE isn't not a lua library. The difference is that LOVE initializes lua internally while a library is passed an already existing lua state.S0lll0s wrote:I think you can require("love") from other Lua environments, so you could start luajit with -jv and give that a go.
I believe the correct way to do it this way would be something like: luajit -jv init.lua
Where init.lua contains something like this (untested):
Code: Select all
table.insert(arg, 1, "C:/path/to/mygame")
love = require("love")
local bootfunc = require("love.boot")
return bootfunc()
Even if you don't use liblove, you can still do it with regular LÖVE without recompiling.I~=Spam wrote:I suggest that you modify and compile LOVE yourself so that it will do this.
You'll have to get the lua files that the LuaJIT 2.0.3 standalone interpreter installs (v.lua, vmdef.lua, dump.lua, etc.) and put them in a place that require will look in, then require one of them (e.g. require("v") to get -jv's functionality.) The lua files have extensive documentation as comments at the start of the file.
For the LuaJIT 2.1 profiler, you can use it directly in LÖVE without doing all that (again via require), as long as LuaJIT 2.1's lua51.dll (rather than LuaJIT 2.0.3's lua51.dll) is next to love.exe.
Documentation describing how to use the LuaJIT 2.1 profiler is here: http://repo.or.cz/w/luajit-2.0.git/blob ... filer.html
Re: Luajit command line options (-jv, -jdump, -jp)
S0lll0s, I~=Spam, Nixola, thanks for the suggestions, simply requiring didn't work, and recompiling is way over my head, but see below:
Also, -jv worked without require("v"), maybe that's how luapower windows binaries are compiled. (see edit)
Even without switches I now have a console that doesn't close when game exits, I wanted that since forever, and all I had to do is ask!
Edit: All this was about luajit init.lua method, I was so happy with it that I didn't realise that next ones were about regular love binary.
Wow, that worked from the first try, even with relative path in table.insert, as in (arg, 1, "mygame"). I tried without any switches and with -jv, will try -jp later. Thank you. Results from -jv are awful, but now at least I know.slime wrote:Even if you don't use liblove, you can still do it with regular LÖVE without recompiling
Even without switches I now have a console that doesn't close when game exits, I wanted that since forever, and all I had to do is ask!
Edit: All this was about luajit init.lua method, I was so happy with it that I didn't realise that next ones were about regular love binary.
Re: Luajit command line options (-jv, -jdump, -jp)
Well, profiler works too. Results are strange and not helpful, but that's out of scope of the original question, technically it's working, I'm sure it's doing its best
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests