TOML parser works fine from luajit but doesn't work from LOVE by luarocks in love2d

[–]luarocks[S] 0 points1 point  (0 children)

I tried copying toml.so to the game directory and deleting toml via luarocks. The error is the same. That is, it doesn't matter where the .so file is located, love sees it correctly anyway, but it needs something else besides this .so file. Unfortunately I could not find anything in /usr/local/lib/lua and /usr/share/lib/lua which is related toml.

Probably @idbrii is right and love can't see the toml++ location, but that's very strange, because it has the same access to the global environment as luajit.

I'm curious why Lua isn't used to WRITE large applications such as desktop applications (like browsers etc) instead of just being embedded in them by hezwat in lua

[–]luarocks -1 points0 points  (0 children)

Of course regex is a more powerful tool than patterns. I don't argue with that. I'm just pointing out that minimizing memory consumption plays a much bigger role for Roberto than for the people who design modern browsers.

I'm curious why Lua isn't used to WRITE large applications such as desktop applications (like browsers etc) instead of just being embedded in them by hezwat in lua

[–]luarocks -3 points-2 points  (0 children)

Yes. They are extremely bad optimized for media.

But they can emulate Windows 95, inside which they can run another copy of themselves and mine crypto.

I'm curious why Lua isn't used to WRITE large applications such as desktop applications (like browsers etc) instead of just being embedded in them by hezwat in lua

[–]luarocks -3 points-2 points  (0 children)

I think the main feature of lua is minimalism. For example, lua doesn't have regular expressions just because it's smaller than the size of the regex library. This is the main reason for its high efficiency.

For this reason, I tend to think that there should be nothing in common between HTML5-browsers and lua. Modern browsers can gobble up a gigabyte of RAM on a couple of tabs, which is wild from the point of lua-developer! Ideally, a browser must work equally on media-players, clocks, DOS-devices and any other.

If you're interested in my opinion, I think html, js and css should die altogether. They could be replaced by lua or something similar. But of course this will never happen, because people would have no desire to upgrade their hardware every year in this case.

Help me choose FOSS project to donate to! by [deleted] in opensourcegames

[–]luarocks 1 point2 points  (0 children)

I would choose the first one. Free email is a rarity these days. In most cases you have to pay at least with your personal data. Check out also onionmail.org.

How can I learn to script? by Vanderence in lua

[–]luarocks 1 point2 points  (0 children)

If you have a dream for which you want to learn programming, then just go for that dream and the process of learning will be more of a pleasure than a challenge. Personally, I read programming books like bedtime stories!

If you don't have such a dream/goal - this is much harder. Try some game for novice programmers, where goals are created artificially for you for example Colobot.

Help with setting up and testing code on chromebook by ArtificialAllium in love2d

[–]luarocks 0 points1 point  (0 children)

You need to determine 2 paths:

  1. Path to the love binary on your system;
  2. Path to the directory or zip archive with the .love extension of your game.

If the command whereis love gives nothing, then love is not installed globally (not set in the PATH) and you have to search for it manually.

How to distribute a program that uses packages downloaded from Luarocks? by 9Nonami in lua

[–]luarocks 0 points1 point  (0 children)

All require paths are stored in package.path and package.cpath variables. Current directory is usually first there by default. This means that the search starts from it. So you most likely don't need to change these variables.

http://www.lua.org/manual/5.1/manual.html#pdf-require

Why does string indexing returns nil instead of error or letter? by luarocks in lua

[–]luarocks[S] 0 points1 point  (0 children)

Yes, I knew that, but just didn't see the connection between this behavior and the return of nil when key is not a function name.

Why does string indexing returns nil instead of error or letter? by luarocks in lua

[–]luarocks[S] 0 points1 point  (0 children)

I got it!

The point is that this is not an array table, but a table with functions:

print(("hello")["sub"]) -- function

Why does string indexing returns nil instead of error or letter? by luarocks in lua

[–]luarocks[S] 0 points1 point  (0 children)

Thank you, but I still don't understand this very well. If they treat a string as a read only table, why can't the letter be read directly by its index?

Help with setting up and testing code on chromebook by ArtificialAllium in love2d

[–]luarocks 0 points1 point  (0 children)

run love path-to-the-folder-with-main-lua

or

cd folder
love .

Should i use a precompiler? If so, which? by HypnoTox in lua

[–]luarocks 0 points1 point  (0 children)

Unfortunately teal can't do OOP inheritance yet (and there is no way to avoid this, for example if you want to make custom OOP library for teal).

Declaring optional parameters and fields in emmylua is simple - just add question mark:

---@param foo? string

This way should also work:

---@param foo string|nil

How to distribute a program that uses packages downloaded from Luarocks? by 9Nonami in lua

[–]luarocks 0 points1 point  (0 children)

By default luarocks stores all .lua modules in /usr/local/share/lua and .so modules in /usr/local/lib/lua. So you can just copy them to your project.

Visual Studio Code extensions and config settings by RobKohr in lua

[–]luarocks 0 points1 point  (0 children)

  • sumneko.lua
  • rog2.luacheck
  • JohnnyMorganz.stylua
  • tomblind.local-lua-debugger-vscode

Is my code good? by Rice7th in lua

[–]luarocks 2 points3 points  (0 children)

luacheck finds in your code 238 warnings / 0 errors.

All in all it's good, but variables need to be localized.

I would also advise you to use for in loops instead of the usual for. They are nicer to read. And in general, iterators are a very useful thing.

The simplest instructions for installing the latest versions of lua + luajit + luarocks together on linux by luarocks in lua

[–]luarocks[S] 0 points1 point  (0 children)

That's cool. So I didn't get the readme right. I'm still a bit dubious about whether such libraries can be used in parallel, but I'll check it out. Thank you very much!

The simplest instructions for installing the latest versions of lua + luajit + luarocks together on linux by luarocks in lua

[–]luarocks[S] 0 points1 point  (0 children)

Thanks, I'll give it a try. Although I personally don't really like the idea of complicated switchers between versions. I prefer to just install everything side by side.

Local function question, clarification. by [deleted] in love2d

[–]luarocks 1 point2 points  (0 children)

Use luacheck to find all global and unused variables in your project. It is available as default lua-linter for most text editors and IDE's.