[{"data":1,"prerenderedAt":193},["ShallowReactive",2],{"project-10449383":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":40,"post_text":42,"what":43,"said":56,"maker_in_thread":118,"shape":123,"grid":127,"attempts":155,"same_week":156,"maker_shows":31,"maker_hidden":185,"reader_version":186,"card":187},"10449383","Luastatic","Build an executable from a Lua program","title","Show HN: Luastatic – Build an executable from a Lua program","https:\u002F\u002Fgithub.com\u002Fers35\u002Fluastatic","github.com","ers35",1445827825,2015,44,13,658,2565,26,"shown","dev_tools","build tool","cli",[24,25,26,27],"lua","executable","static binary","lua compiler","curious",0.242,{"positive":31,"neutral":32,"mixed":33,"critical":33},3,7,0,10,{"performance":36,"execution":38,"idea":39},{"positive":37,"critical":33},2,{"positive":33,"critical":33},{"positive":33,"critical":33},[41,31,31,33,31,31,31,41,31,31,33,33,41],5,null,{"problem":44,"audience":42,"pricing":42,"motivation":42,"time_to_build":42,"stack":50,"openness":55,"stage":55,"team_size":55},{"value":45,"source":46,"evidence":47},"Packaging a Lua program into a single executable","inferred",[48],{"id":49},"post",[51],{"value":52,"source":46,"evidence":53},"Lua",[54],{"id":49},"unknown",{"praise":57,"objections":66,"requests":67,"questions":81,"alternatives":89},[58],{"value":59,"source":60,"evidence":61},"Small output binaries compared to alternatives","commenter",[62],{"id":63,"by":64,"text":65},"10450350","motiejus","Pretty good size: 214K (on amd64 Linux): ``` $ ls -lhd hello -rwxr-xr-x 1 admin admin 214K Oct 26 09:53 hello $ ldd hello linux-vdso.so.1 (0x00007fff5f5ff000) libm.so.6 =>…",[],[68,75],{"value":69,"source":70,"evidence":71},"LuaJIT support","maker",[72],{"id":73,"by":11,"text":74},"10450543","LuaJIT will be supported in the future. I will take a look at Terra.",{"value":76,"source":60,"evidence":77},"LuaRocks integration",[78],{"id":79,"by":11,"text":80},"10450599","Lua binary modules are supported by referencing the path to the module's static library and any dependent libraries. Used packages are not automatically pulled in. LuaRocks…",[82],{"value":83,"source":60,"evidence":84},"Why luac output cannot be linked into a static library",[85],{"id":86,"by":87,"text":88},"10452177","0x01","That's a neat trick! Is there any reason you can't do this with luac? I tried the equivalent to what you're doing with luac, but gcc complains that \"member libmylib.a(luafunc.o)…",[90,97,104,111],{"value":91,"source":60,"evidence":92},"LuaJIT bundling with ar and gcc",[93],{"id":94,"by":95,"text":96},"10451611","camperman","You can do this in Luajit with the following trick: ``` for f in *.lua; do luajit -b $f `basename $f .lua`.o done ar rcus libmylib.a *.o gcc -o myexe main-stub.c…",{"value":98,"source":60,"evidence":99},"squish",[100],{"id":101,"by":102,"text":103},"10450740","larme","For multiple lua files, you can first bundle them into a single lua file using squish.[0] [0]: https:\u002F\u002Fgithub.com\u002FLuaDist\u002Fsquish",{"value":105,"source":60,"evidence":106},"Luvi",[107],{"id":108,"by":109,"text":110},"10450447","fasteo","Also check: Bundle [1], using LuaJIT Luvi [2], which is also able to generate a single file executable and you can include static resources. [1] https:\u002F\u002Fluapower.com\u002Fbundle [2]…",{"value":112,"source":60,"evidence":113},"PyInstaller",[114],{"id":115,"by":116,"text":117},"10450441","unmole","Similar project for Python: http:\u002F\u002Fwww.pyinstaller.org\u002F Works with multiple source files and supports widely used Python modules out of the box.",{"comments":37,"answered":119,"key":120},1,[121,122],{"id":79,"text":80},{"id":73,"text":74},{"commenters":34,"max_depth":124,"maker_replies":37,"first_comment_mins":125,"lifespan_hours":126},4,402,32,[128,130,132,134,137,138,140,141,142,145,148,149,150],[94,33,41,129,95,33],"project\u002Fpositive\u002Fperformance",[86,33,31,131,87,33],"project\u002Fneutral\u002Fexecution",[133,33,31,131,95,33],"10452946",[135,33,33,136,87,33],"10457163","commenter\u002Fpositive\u002Fnone",[101,119,31,131,102,33],[108,37,31,139,109,33],"project\u002Fneutral\u002Fidea",[115,31,31,139,116,33],[63,124,41,129,64,33],[143,41,31,139,144,33],"10450277","hbbio",[146,41,31,139,147,33],"10450417","Toenex",[79,41,33,131,11,119],[73,41,33,131,11,119],[151,152,41,153,154,33],"10451628",6,"maker\u002Fpositive\u002Fnone","ifoundthetao",[],[157,162,167,171,175,180],{"id":158,"name":159,"points":160,"category":161},"10445380","Freeze",160,"infrastructure",{"id":163,"name":164,"points":165,"category":166},"10453136","SVG Path Builder",95,"creative",{"id":168,"name":169,"points":170,"category":20},"10445461","Desk",94,{"id":172,"name":173,"points":174,"category":20},"10452048","PDFx",93,{"id":176,"name":177,"points":178,"category":179},"10457429","NotCRUD",70,"consumer_social",{"id":181,"name":182,"points":183,"category":184},"10433615","Hibou",69,"productivity",false,"v2",{"id":188,"name":5,"line":6,"ai":185,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":189,"top":18,"kw":190,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":191,"url":9,"mix":192,"praise":59,"objection":-1,"sub":21},10449383,0.24,[24,25,26,27],"5330333533005",[31,32,33,33],1793990932613]