HNHacker News
TopNewBestAskShowJobs

Hoppetosse

130 karma · joined May 6, 2019

submissionscomments
Hoppetosse··on A Regular Expression Matcher (2007)
Bob Nystrom describes his language Wren through number of semicolons, which I find interesting.

Doesn't work for every language, though =P

Hoppetosse··on Looking at Zig Programming Language
If you want to handle the error and also bubble it up, maybe even changing the what error bubbles up, you can just return an error from within the catch block after doing whatever handling you want. Either the captured error or something else.

Specifically for recursive descent parsers, I pass around a reference to an regular struct that acts as an ErrorInfo object, and use that to pass diagnostic information up the stack. Control flow is still managed by the error returns, any additional info goes in the parameter.

There is (was?) a proposal to add that capability to the language but Im not sure it had much traction.

Hoppetosse··on Child suicides in Japan hit record high
It can also be an artifact of a foreign language. The french interrogatory form can be the same as the declarative. It seems likely in this case, their use of "therefore" is equivalent to the fench "alors" which is often employed to "interrogate a declaration"
Hoppetosse··on PICO-8 – Fantasy Console
There are a few similar open source projects, like Tic-80 and Liko-12. Both can be programmed with Lua, but Tic-80 can also be programmed with others like Javascript and Wren and the porting process can be fairly simple.
Hoppetosse··on Zig, Skia, Clojure, Geometry and the Japanese TV Show: ICFP Contest 2021
The @Vector provided is actually a reference to SIMD vectors and there has been discussion to rename it to something that reflects this more clearly.

https://github.com/ziglang/zig/issues/7305

Hoppetosse··on Why I rewrote my Rust keyboard firmware in Zig: consistency, mastery, and fun
In many ways, it already has. Zig has been under development for several years now and its syntax and semantics have change a lot since its first iterations. There are still some breaking changes coming that you can find at https://github.com/ziglang/zig/issues.

One of the cooler aspects of Zig's breaking changes is that its formatting tool can automatically update your code to the new syntax.

Hoppetosse··on Ziglings: Learn the Zig programming language by fixing tiny broken programs
The standard library has a General Purpose Allocator that can catch some of the errors that ASAN can, like memory leaks.
Hoppetosse··on Game Boy Advance “Hello World” Using Zig
Zig was started with that exact use case at the forefront of its design.

- Zig has no hard dependency on libc, it's the user's choice whether he wants to link it or not. It ships musl libc and can build/link it for most (all?) supported targets.

- Most of Zig's standard library works on freestanding targets. No runtime needed. There are no implicit allocators, so the user must use an allocator shipped with the standard library or implement their own.

- Standard library is still in its early days but already provides a lot of functionality out of the box, from containers to io.

- Using the standard library is optional. When it is used, only what is used gets included. The standard library is built from source every time (though there is caching) and its semantic analysis basically does LTO in the codegen stage so you end up with pretty slim binaries.

Here's a couple of examples:

- https://github.com/andrewrk/clashos

- https://github.com/AndreaOrru/zen

Hoppetosse··on Tetris clone written in Zig running on WebGL and WebAssembly
I forked a project, didn't even realize it didn't have a license. I'll ask the original creator to decide.
Hoppetosse··on Tetris clone written in Zig running on WebGL and WebAssembly
More than one person has mentioned this. Maybe an audio cue will make it more obvious it's on purpose...
Hoppetosse··on Tetris clone written in Zig running on WebGL and WebAssembly
Thanks for the feedback. I've reworked the page so that it's less likely that the game does not fit in a screen without scrolling - not ideal, but it'll help!
Hoppetosse··on Tetris clone written in Zig running on WebGL and WebAssembly
This is actually a port of the demo made by Andrew Kelley, which was originally written for the desktop using GLFW.

My plan is to integrate my changes into the original project so that it can export to desktop and web.