Preferences

fwsgonzo
Joined 1,660 karma

  1. It's designed to be low-latency enough that calling into the scripting solution is not considered a high cost. With something like Lua you're likely to hold back a lot, as it has a really high entry/exit cost, and the same is true for calling out to the host. libloong has 40x lower latencies.
  2. Hey, and thanks! libloong is a little bit restrained in its design. It's designed specifically to be the lowest latency sandbox. libriscv is more flexible in that it can load dynamic ELFs and run programs with LuaJIT embedded. I actually haven't been able to run Go programs in libloong yet, but I do want to reach that level!
  3. Merry Christmas to all
  4. I would never have had a working LoongArch emulator in 2 weeks at the kind of quality that I desire without it. Not because it writes perfect code, but because it sets everything up according to my will, does some things badly, and then I can take over and do the rest. The first week I was just amending a single commit that set everything up right and got a few programs working. A week after that it runs on multiple platforms with JIT-compilation. I'm not sure what to say, really. I obviously understand the subject matter deeply in this case. I probably wouldn't have had this result if I ventured into the unknown.

    Although, I also made it create Rust and Go bindings. Two languages I don't really know that well. Or, at least not well enough for that kind of start-to-finish result.

    Another commenter wrote a really interesting question: How do you not degrade your abilities? I have to say that I still had to spend days figuring out really hard problems. Who knew that 64-bit MinGW has a different struct layout for gettimeofday than 64-bit Linux? It's not that it's not obvious in hindsight, but it took me a really long time to figure out that was the issue, when all I have to go on is something that looks like incorrect instruction emulation. I must have read the LoongArch manual up and down several times and gone through instructions one by one, disabling everything I could think of, before finally landing on the culprit just being a mis-emulated kind-of legacy system call that tells you the time. ... and if the LLM had found this issue for me, I would have been very happy about it.

    There are still unknowns that LLMs cannot help with, like running Golang programs inside the emulator. Golang has a complex run-time that uses signal-based preemption (sysmon) and threads and many other things, which I do emulate, but there is still something missing to pass all the way through to main() even for a simple Hello World. Who knows if it's the ucontext that signals can pass or something with threads or per-state signal state. Progression will require reading the Go system libraries (which are plain source code), the assembly for the given architecture (LA64), and perhaps instrumenting it so that I can see what's going wrong. Another route could be implementing an RSP server for remote GDB via a simple TCP socket.

    As a conclusion, I will say that I can only remember twice I ditched everything the LLM did and just did it myself from scratch. It's bound to happen, as programming is an opinionated art. But I've used it a lot just to see what it can dream up, and it has occasionally impressed. Other times I'm in disbelief as it mishandles simple things like preventing an extra masking operation by moving something signed into the top bits so that extracting it is a single shift, while sharing space with something else in the lower bits. Overall, I feel like I've spent more time thinking about more high-level things (and occasionally low-level optimizations).

  5. Just have a look at r/anthropic. It's well known that you hit a limit after no usage at all with Pro (aka. demo). Chargeback is the only thing they will understand.
  6. I agree. I also challenge readers to watch TV broadcasts from politicians speaking in 70s, 80s and even 90s. You won't even believe your ears. But, the slow takeover of the world by international conglomerates buying up everything else, merging and bankrupting competition just doesn't seem to be on anyones mind with any power to deal with it. An acquaintance works at one of these Frankensteins monsters and there is a hodge podge of internal systems. It's hard to believe how many companies they have bought up over the decades.
  7. I haven't bailed yet, but your problems is par for the course in C++. The only saving grace is libraries with simple/modern CMake rules, which is not always available. A typical offender is protobuf, which is really hard to statically link correctly on MinGW. Libraries that never graduate from custom makefiles are the worst offenders. With Automake being just barely above that again.

    It is the biggest problem with C++ right now. We can't have nice things (no networking in the stdlib), and we also can't have nice packages (no networking in $pkg), so we end up with whatever appears on search for site:github.com and C++ whatever. It's really not that great. The only tradeoff is we really care about our deps, and won't pull in the world. So we're harder to target for supply chain attacks.

    You shouldn't be waiting 20mins for CI builds though, unless you have a massive codebase and 10 platforms to build for. If you're making a Godot addon for every platform, I get it. I have that issue. But the 20mins are down from 50mins without ccache. Ccache is ~5 lines in the GA yaml.

  8. That's cool! I do have a habit of writing ELF post-processors as a part of the CMake build system I inevitably end up writing. There's a handy POST_BUILD you can attach to programs which I use very often for things like execute-only (XO) and apparently also to rewrite function entries for functions I can't --wrap.

    Example: https://github.com/varnish/libvmod-riscv/blob/main/program/c...

    chperm can change the permissions of a segment to just execute, instead of read+execute. Of course, you will need a custom linker script because the default linker scripts will merge .text and read-only data to save space.

    Currently, I'm battling a Rust program that has a built-in function called __memcmpeq, which isn't a global, so I can't --wrap it.

  9. I remember when the C++ subreddit got depressing after the memory-safety debacle. I wrote in plain-text that it's not about memory-safety and it never will be. C and C++ has a major problem: Managing large projects with multiple dependencies is horrible, and integration is horrible, and all the work-arounds and special features (like precompiled headers) all have problems, footguns. There is no end to the complexity of managing a large C++ project, for example.

    I know this because I manage several. To this day, building on Windows is a chore and a half, and I consider my build process to be barely working, and it will one day break simply because the packages I depend on will have some new dependency. As a very recent example is protobuf suddenly depending on parts of abseil.

    Memory safety is that extra thing that makes the decision easier.

    As for Rust, there are problems too, but to a much smaller degree. As an example, compiling for RISC-V requires a cross-compiler (or at least the linker). Cross-compiling to RISC-V with Go does not.

    A final anecdote at the end: I recently added support for Common Access Token in a Rust project, and it was exactly as easy as I thought it would be. I'm not much of a Rust programmer, but I cannot express strongly enough just how big of a difference this makes to productivity. In C++ land we sort of ended up agreeing to never agree on how to get proper networking. It's absurd.

  10. Both my grandparents were antifa too.
  11. Is there any living person that thinks the UK people want ChatControl? No? Me neither.
  12. The whole thing has made me unsure if I want to continue using Claude at all.
  13. Yep, when steam didn't work I got it immediately on GoG. Glad I did because it works flawlessly on Linux, and it comes with a Linux installer!
  14. The best way (anecdotally) for me has been to not understand the subject matter at all, and just work work work on something until it's near completion. At that point understanding the subject matter is much easier, and you can compare it to your own understanding and work. Many times I've since improved my work from subject matter because other people have had great ideas that stood the test of time, and very occasionally my work has created a new frontier without me really understanding it at the time. Still, revolutionary ideas are not always something that can be turned into a business. Funnily, I see many business ideas are just gluing things together, and I don't think anyone is really upset about that.

    As you said though, sometimes you have to go the wrong way (knowingly or unknowingly) just to see what's there or if there aren't missed opportunities. Heavily established (sub-)fields can be very rigid and hard to find new ground in.

  15. Yeah, I'm watching people walk around in SK and JP and I really want to visit one day. One day before it's too late. Both countries will evaporate.
  16. I'm working on an addon for Godot called Godot Sandbox, and we're trying to also build it as a module. A module is embeddable into Godot, so that you can have only one executable be the whole game. Addons are dynamically loaded at run-time. It's been a lot of work, but integration is just as important as making the addon itself.
  17. This is a white lie.
  18. I've read so many comments, many of which I agree with and some which I don't. Either way, this comment is the only one that touches on the subject of womens careers. We are new parents and my wife is scared that she will lose her job despite protections. We are sick a lot (almost permanently so far) as childcare is a petri dish. We are also sleeping poorly almost every other day. She sometimes has meetings in the afternoon because people can't respect other peoples time off, and has to sometimes have a screaming child in the background. If she were to lose her job, we would have serious economic issues, despite both of us having good jobs. It's not great. It's becoming very clear to me that something is wrong both economically and politically when it comes to child rearing.
  19. I can see a few cool projects on show: https://www.hackerneue.com/show
  20. Yep, we are new parents and we are almost 40. There just wasn't any moment before where it was possible to start a family. We are comfortable but utterly alone in our box, with no grandparents or extended family in sight. Also, with the expectation that outside is for cars. So, there's 1-2 hours at the end of the day for us which is largely cleaning and de-stressing. If anyone had laid this fully out for us before we made this choice, it would have been an easy heck no.
  21. I tried optimizing my CPU emulator dispatch in raw assembly to see if I could run a simple fibonacci program faster than C++. And I was not even close. In the end I merged it and made it a default-disabled dispatch option, because ... there has to be a way to make it faster!

    If you are daring, you can find my puny attempt here: https://github.com/libriscv/libriscv/blob/master/lib/librisc...

    I did manage to improve it once I figured out some of the various modes of accessing memory, and I even managed to cut the jump table down from 64- to 32-bit which should help keep it in memory. I made the jump table part of .text in order to make it RIP-relative. For the fibonacci sequence program, not many bytecodes are needed. I would greatly appreciate some tips on what can be improved there.

  22. Same for me, except I'm nearing 40. All my brothers have it to various degrees, and since I have a job and doing OK, I cannot be helped. It's extremely annoying that access to medicine is gated by the personal opinions of professionals (and that the medicine is jail-worthy to begin with). Specifically, I was denied because too old, in writing.

This user hasn’t submitted anything.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal