This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcall(require, 'luarocks.require') | |
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs | |
-------------------------------------------------------------------------------- | |
-- Some value printing code | |
-------------------------------------------------------------------------------- | |
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo | |
require 'lua-nucleo.strict' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcall(require, 'luarocks.require') | |
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs | |
-------------------------------------------------------------------------------- | |
-- Some value printing code | |
-------------------------------------------------------------------------------- | |
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo | |
require 'lua-nucleo.strict' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Popping up a message box on Windows with LuaJIT2 Git HEAD: | |
-- (Example by Mike Pall) | |
local ffi = require("ffi") | |
ffi.cdef[[ | |
int MessageBoxA(void *w, const char *txt, const char *cap, int type); | |
]] | |
ffi.C.MessageBoxA(nil, "Hello world!", "Test", 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcall(require, 'luarocks.require') | |
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs | |
-------------------------------------------------------------------------------- | |
-- Some value printing code | |
-------------------------------------------------------------------------------- | |
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo | |
require 'lua-nucleo.strict' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcall(require, 'luarocks.require') | |
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs | |
-------------------------------------------------------------------------------- | |
-- Some value printing code | |
-------------------------------------------------------------------------------- | |
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo | |
require 'lua-nucleo.strict' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcall(require, 'luarocks.require') | |
local sidereal = require 'sidereal' -- sudo luarocks install sidereal --from=http://luarocks.org/repositories/rocks-cvs | |
-------------------------------------------------------------------------------- | |
-- Some value printing code | |
-------------------------------------------------------------------------------- | |
require 'lua-nucleo.module' -- sudo luarocks install lua-nucleo | |
require 'lua-nucleo.strict' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function build_message_box_imperative(gui_builder) | |
local my_dialog = gui_builder:dialog() | |
my_dialog:set_title("Message Box") | |
local my_label = gui_builder:label() | |
my_label:set_font_size(20) | |
my_label:set_text("Hello, world!") | |
my_dialog:add(my_label) | |
local my_button = gui_builder:button() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<Module> | |
<ModulePrefs title="GitHub Gist Gadget"> | |
<Require feature="wave" /> | |
<Require feature="dynamic-height" /> | |
</ModulePrefs> | |
<Content type="html"> | |
<![CDATA[ | |
<div id="content_div"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
luamarca $ ./run_benchmark.sh bench/sort-fedin.lua 1e5 | |
Results: | |
luajit -O | |
------------------------------------------------------------------- | |
name | rel | abs s / iter = us (1e-6 s) / iter | |
------------------------------------------------------------------- | |
bubble_nocallback_s | 1.0000 | 0.51 / 100000 = 5.100000 us | |
bubble_nocallback | 1.0000 | 0.51 / 100000 = 5.100000 us |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local luabins = require "luabins" | |
local status, a, b, c = assert( | |
luabins.load(luabins.save("A", "B", "C")) | |
) | |
print(a, b, c) --> A B C |
NewerOlder