gucci-on-fleek

Joined 1 year ago

Karma
1,382
Submissions
465
Member since
May 18
https://www.maxchernoff.ca/
View on Hacker News

Recent submissions

Comment · 22 hours ago
Comment · 1 day ago
Comment · 2 days ago
> To me, it seems odd not to care.

If you don't mind me asking, why do you think that? I'm not trying to start a debate, and I'm sympathetic to many of the reasons why some people are against LLMs (the environment, copyright issues, loss of jobs, not liking chatbots, not trusting the current companies, etc.), but I'm curious why you are against them.

(I don't really understand one being so against LLMs that one tries to avoid software that contains even small amounts of LLM-written code, but I know that a lot of well-informed people feel this way, and it seems far more likely that I'm the one missing something rather than everyone else being wrong.)

Comment · 3 days ago
I'm not the OP, but I would personally say that not wanting to work with LLM-generated output (including that submitted via PRs and issues) is reasonable, but not wanting to use LLM-generated code from well-regarded established projects (not vibe-coded slop) is veering closer to tribalism.

Because to me, it's entirely fair to care about the process when you're the one working with it, but if you've never looked at the code and it works well, it seems odd to care how 10% of it was produced.

I still wouldn't quite use the loaded "tribalism" term here myself though, because there are still a few valid reasons to be skeptical of LLM-generated code, but for many people, their hard anti-LLM stance appears to be more of a shibboleth than a principled stance from my perspective.

Comment · 5 days ago
Isn't there already a natural "tax" of the cost of office space?
Comment · 6 days ago
Comment · 6 days ago
Comment · 8 days ago
> you may have to compile each binary module

Correct, but I'd argue that you need to do this anyways (well, I do this anyways), because I don't like the alternative of redistributing binaries compiled by random third parties from the internet.

> link everything against the Lua VM, and write glue/loading code to make everything work together (see the comment below regarding LuaSocket)

> Of course, it's possible. But it's a lot of manual work, especially for newcomers.

To be clear, I think that your project is great, but this really isn't that much work:

  # FILE: .gitignore
  program
  *.luac
  *.o
  
  # FILE: Makefile
  CFLAGS := -std=c23 -Wall -Wextra -Werror
  
  ifeq "${mode}" "debug"
      CFLAGS += -ggdb3 -fanalyzer -fsanitize=address,undefined,leak
  else
      CFLAGS += -O2 -flto -s
  endif
  
  %.luac: %.lua
      luac -o $@ $^
  
  %.o: %.c
      ${CC} -c -o $@ $< ${CFLAGS}
  
  c_libraries := library.o
  lua_libraries := main.luac
  
  program: main.c ${c_libraries} ${lua_libraries}
      ${CC} -o $@ $< ${c_libraries} ${CFLAGS} -llua
  
  // FILE: library.c
  #include <lauxlib.h>
  #include <lua.h>
  #include <lualib.h>
  #include <stdcountof.h>
  
  static int test(lua_State *L) {
      lua_pushstring(L, "Hello from C!");
      return 1;
  }
  
  int luaopen_library(lua_State *L) {
      luaL_Reg library[] = {
          {"test", test},
          {nullptr, nullptr},
      };
      luaL_newlib(L, library);
      return 1;
  }
  
  // FILE: main.c
  #include <lauxlib.h>
  #include <lua.h>
  #include <lualib.h>
  #include <stdcountof.h>
  
  #define preload_c_lib(name)                       \
      do {                                          \
          extern int luaopen_##name(lua_State * L); \
          lua_pushcfunction(L, luaopen_##name);     \
          lua_setfield(L, -2, #name);               \
      } while (0)
  
  #define preload_lua_lib(name)                                         \
      do {                                                              \
          luaL_loadbufferx(L, &name[0], countof(name) - 1, #name, "b"); \
          lua_setfield(L, -2, #name);                                   \
      } while (0)
  
  static void initialize_modules(lua_State *L) {
      // Load standard modules.
      luaL_openlibs(L);
  
      // Load external modules.
      lua_getglobal(L, "package");
      lua_getfield(L, -1, "preload");
  
      // "main.lua"
      static char const main[] = {
          #embed "main.luac" suffix(, '\0')
      };
      preload_lua_lib(main);
  
      // "library.o"
      preload_c_lib(library);
  
      lua_settop(L, 0);
  }
  
  int main() {
      lua_State *L = luaL_newstate();
  
      // Initialize the modules.
      initialize_modules(L);
  
      // Run main script
      if (luaL_dostring(L, "require('main')()") != LUA_OK) {
          printf("Error: %s", lua_tostring(L, -1));
      }
  
      lua_close(L);
      return 0;
  }
  
  -- FILE: main.lua
  return function()
      local library = require("library")
      print(library.test())
      print("Hello from Lua!")
  end
To run:

  $ make && ./program
  cc -o program main.c library.o -std=c23 -Wall -Wextra -Werror -O2 -flto -s -llua
  Hello from C!
  Hello from Lua!
Comment · 9 days ago
> Some platforms (Windows I see you !) don't permit to link binary modules to a static executable

If you have the source code for these modules, you can statically link to them too. I've done this myself for Windows a few times, and it works pretty well in my experience.

Comment · 9 days ago
I wouldn't consider static linking + #embed to be hacky though, and that's all that it takes to deploy a standalone Lua program.
Comment · 10 days ago
Comment · 11 days ago
Comment · 11 days ago
> - Do you support introducing voter ID for Alberta elections?

I realized that you copied that from BBC, but that's not a correct summary of the question. The official wording [0] of that question is

> 5. Do you support the Government of Alberta introducing a law requiring individuals to provide proof of citizenship, such as a passport, birth certificate or citizenship card, to vote in an Alberta provincial election?

Voter ID is already required for elections [1], but proof of citizenship is not. The vast majority of people (>90% in the previous elections that I worked at) used their drivers' licences as ID, but these don't list your citizenship. And the problem with passports and birth certificates is that they don't show your address (which is required to ensure that you're voting in the correct riding), so they also wouldn't be sufficient.

> - Do you support the Alberta government working with other provinces to allow provinces to opt out of federal programs?

That's also not a correct summary. Provinces are already allowed to opt out of most federally-funded but provincially-administered programs, but nobody wants to do so since that means losing out on the federal funding. The official wording of that question [0] was actually

> 8. Do you support the Government of Alberta working with the governments of other willing provinces to amend the Canadian Constitution to allow provinces to opt out of federal programs that intrude on provincial jurisdiction such as health care, education, and social services, without a province losing any of the associated federal funding for use in its social programs?

So this question is actually asking if Alberta should be allowed to opt out of the federal governments conditions without also opting out of the funding.

[0]: https://www.elections.ab.ca/elections/referendum/

[1]: https://www.elections.ab.ca/voters/id-required-to-vote/

Comment · 11 days ago
Does the version number going from v7.X->v8.0 mean that this is a larger update than v7.8->v7.9, or does the numbering just automatically roll over to the next major version when it reaches vX.9?
Comment · 13 days ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton