HNHacker News
TopNewBestAskShowJobs

hgs3

1,590 karma · joined August 11, 2020

submissionscomments
hgs3··on Show HN: I made Confetti: a configuration language file format
Yes, the "${}" would be for the program to evaluate; referencing environment variables that way isn't uncommon in Unix configuration files.

"Reverse Solidus" is the Unicode name for the character [1], so if you don't like the name, blame Unicode :)

I hadn't thought of using '[' and ']' for multi-line directives, that's an interesting suggestion. It vaguely resembles arrays as they appear in various other languages. It fits with Confetti's design of, ultimately, being user interpreted.

[1] https://www.compart.com/en/unicode/U+005C

hgs3··on Show HN: I made Confetti: a configuration language file format
The "general category" [1] and "whitespace" [2] properties are real character properties defined by Unicode. Referring to them is, ideally, how a language that supports Unicode should do things.

[1] https://www.unicode.org/reports/tr44/#GC_Values_Table

[2] https://www.unicode.org/reports/tr44/#White_Space

hgs3··on Show HN: I made Confetti: a configuration language file format
The "expression arguments extension" is intended to allow for 'richer' expressions wherever an argument is expected. In the following example, it shows how you might use it if you need basic control flow in your configuration:

    if (x > y) {
        print "x is greater than y"
    }
It's freeform so your application would need to interpret what's between the '(' and ')'.

The "punctuator arguments extension" is the one I'm most anxious about since it might be too flexible, but I'd like to hear feedback. It lets you define your own domain-specific punctuators for your configuration so, for example, you might decide that "=" is a punctuator which means the following is equivalent:

    x = 123
    x=123
Under standard interpretation, if you wanted "=" it be distinct from "x" and "123", then white space would be required.

The "comment syntax extension" is just C style comments.

My goal was to keep the language basic while encouraging custom flavors. If an extension becomes ubiquitous, then - depending on what it is - it might merge with the standard or be added to the annex.

hgs3··on Show HN: I made Confetti: a configuration language file format
Indention is not significant. The example was supposed to demonstrate how you might use individual directives for pseudo-grouping. The example was inspired by premake [1] which takes this approach, but in Lua.

[1] https://premake.github.io/docs/Your-First-Script

hgs3··on Show HN: I made Confetti: a configuration language file format
Good catch! It's "unopinionated" for the user and "opinionted" in its design decisions. I'll stick with "unopinionated" for consistency.
hgs3··on Has the decline of knowledge work begun?
The book you referenced appears to be about the rise of Marxism. I'm neither agreeing nor disagreeing with the GP when I say this, but I think it's worth pointing out that you can democratize ownership under capitalism, e.g. a worker cooperative [1] is a business owned by the workers.

[1] https://en.wikipedia.org/wiki/Worker_cooperative

hgs3··on Has the decline of knowledge work begun?
The vast majority of jobs that sustain our standard of living are blue-collar: farmers who grow our food, textile workers who make our clothes, construction workers who build our homes, plumbers, electricians, waste disposal workers, etc. I'd say it's white-collar work that became overinflated this past century, largely as a reaction to the automation and outsourcing of many traditional blue-collar roles.

Now, with white-collar jobs themselves increasingly at risk, it's unclear where people will turn. The economic pie continues to shrink, and I don't see that trend reversing.

It appears to me that our socio-economic model simply doesn't scale with technology. We need to have a constructive conversation about how to adapt.

hgs3··on Implementing Generic Types in C
Is this the version of "generics" the C committee is leaning towards? Last I checked there were at least three other proposals [1] [2] [3].

[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3212.pdf

[2] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2924.pdf

[3] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2853.pdf

hgs3··on Implementing Generic Types in C
It's worth mentioning that there are dedicated processors, like m4, and templating engines, like Jinja, if you need something battle-tested.
hgs3··on Memory safety for web fonts
Is the FreeType2 test suite public? It looks like the project's tests/ directory only contains a script for downloading a single font [1]. They have a fuzz test repo with what appears to be a corpus of only a few hundred tests [2]. For critical infrastructure, like FreeType, I'd expect hundreds of thousands if not millions of tests, just like SQLite [3].

[1] https://gitlab.freedesktop.org/freetype/freetype/

[2] https://github.com/freetype/freetype2-testing/

[3] https://www.sqlite.org/testing.html

hgs3··on I stopped everything and started writing C again
Python's complexity has been increasing since Guido stepped away and it is off-putting. The language is still nowhere near as complex as Ruby or others, but I am keeping my eyes open for alternatives.
hgs3··on I stopped everything and started writing C again
Agreed. C, Go, Python, and Lua are my go-to languages because of their simplicity. It's unfortunate, but in my opinion, most mainstream languages are needlessly complex.

In my experience, whether it's software architecture or programming language design, it's easy to make things complicated, but it takes vision and discipline to keep them simple.

hgs3··on Show HN: VSC – An open source 3D Rendering Engine in C++
> Be aware that the AGPL license might be a problem for many people.

Nothing prevents the author from selling closed-source licenses, as long as they retain sole copyright over the code.

hgs3··on Show HN: VSC – An open source 3D Rendering Engine in C++
> I'm not about to hand off anything I pour months and years into to my competitors for free.

Library authors can pour "months and years" into their projects, and yet you expect them (but not yourself) to give away their code under more permissive terms, while you keep yours closed? The (A)GPL is a great choice because it forces people like you to either (1) open up your code or (2) pay for a closed-source license.

hgs3··on Show HN: I built a JSON and JSON5 parser with MISRA C conformance
Commercially speaking, the target audience is embedded developers. It's FOSS because, a few months back, I released a MISRA compliant Unicode algorithms library [1] and I received comments on HN asking why it wasn't under a FOSS license. With this project, I wanted to experiment with dual-licensing. I'm using a copyleft license because I fear a permissive license will mean no sales.

[1] https://news.ycombinator.com/item?id=42423988

hgs3··on Show HN: I built a JSON and JSON5 parser with MISRA C conformance
Embedded systems are the primary use case, but any safety critical system would presumably want this.

My focus wasn't speed, but rather high-assurance. On a resource-constrained embedded system, you're likely not working with huge JSON structures. The scanner processes JSON incrementally, so if memory pressure is a concern, you can do your processing in small, incremental chunks.

hgs3··on Ask HN: A retrofitted C dialect?
C2Y, the next C revision, introduced "enable safe programming" into the C standard charter [1]. The C committee is eager for proposals like this.

Adding a new feature, like slices, as a Clang extension would be considerably faster than creating a new dialect or language, and it would be immediately usable by every C codebase building with Clang. Even if the feature is "slow" to be incorporated into the standard, it would still be accessible as a compiler extension in the interim.

[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3223.pdf

hgs3··on Ask HN: A retrofitted C dialect?
C is still evolving. Instead of creating a new C dialect, why not try improving C itself? You can prototype new features with Clang and submit a technical proposal to the C committee for review. Regarding "memory safety" specifically, many of the challenges folks face with RAM management are related to bounds checking so consider prototyping a slices concept [1].

[1] https://www.digitalmars.com/articles/C-biggest-mistake.html

hgs3··on OpenJKDF2 – A cross-platform reimplementation of JKDF2 in C
There's also a reimplementation of the original Dark Forces [1].

[1] https://github.com/luciusDXL/TheForceEngine

hgs3··on Greg K-H: "Writing new code in Rust is a win for all of us"
> It would be less problematic if used for different purposes or layers, like frontend and backend.

Wouldn't a microkernel architecture shine here? Drivers could, presumably, reside in their own projects and therefore be written in any language: Rust, Zig, Nim, D, whatever.

hgs3··on Collection of one-file C/C++ libraries with no dependencies, primarily for games
> Also, C programmers don't seem to use any package managers other than the default system package manager and maybe git sub-modules (at least, not that I know of).

For what it's worth, as someone who primarily writes C, not C++, I use the system package manager, vendoring, and sometimes Git submodules, depending on the project. On Windows, when I'm using MSYS2, I use the pacman package manager. If I'm targeting MSVC, I use CMake. For CMake, on Windows, I create my own directory where I place prebuilt dependencies for CMake to find [1]. With this approach, I can rely on CMake's builtin find_package behavior (no need for vcpkg and configure-time toolchain flags).

[1] https://cmake.org/cmake/help/latest/command/find_package.htm...

hgs3··on Portals and Quake
Some additional points of interest: Quake level designers could use "hint" brushes to help the BSP compiler determine where to create cells. Starting with Quake II, designers were able to place "area portals" which are portals programmers could toggle at runtime (think disabling a doorway portal when the door is closed).
hgs3··on App Should Have Been a Website (and Probably Your Game Too)
Isn't some of what you're describing a critique of walled garden platforms rather than web vs native? e.g. When I self-publish a native desktop app, I can pick the DRM, code updater, and payment processor I use.
hgs3··on Vultr Raises $333M at $3.5B Valuation
I've been using Vultr for the past 6-ish months and I've been happy with them. They have great prices for what you get. Sadly, I feel that review sites often skew negative because I think people are more motivated to find time to share a negative experience than a positive one.
hgs3··on Show HN: Brisk – Cross-Platform C++ GUI Framework: Declarative, Reactive, Fast
Nice project! Do you think you'd ever support a "live preview" or "hot reloading" of the UI or is that beyond the scope of the project?
hgs3··on Updates to H-1B
It's supply and demand economics: if there is a low supply of workers and a high demand for them, then employers are supposed to compete for them with more pay, more benefits, training/education, etc. When the supply of workers is artificially increased, then companies have less incentive to compete. It becomes a buyer's market for employers.
hgs3··on Show HN: I built an embeddable Unicode library with MISRA C conformance
You can download a prebuilt amalgamation from GitHub to see the amalgamated C code [1]. The GitHub repo contains the code that generates the amalgamation.

[1] https://github.com/railgunlabs/unicorn/releases/

hgs3··on Show HN: I built an embeddable Unicode library with MISRA C conformance
I appreciate the kind words. When I was designing the website, I wanted to inject my personality into it. I wasn't sure how well the "playfulness" would go over, but I'm glad you enjoyed it.
hgs3··on Show HN: I built an embeddable Unicode library with MISRA C conformance
> This is commercial only.

You can use Unicorn for non-commercial use [1], but yes, for commercial use you need to buy a license.

> It's much faster to use precomputed tables per algorithm

You're absolutely right about using precomputed tables per algorithm. That is the secret to the library's speed.

> Free and small is my safeclib, which does about half of it.

I like safeclib! It's nice to hear from the author. It's worth distinguishing that safeclib is a safer string library whereas Unicorn is a Unicode algorithms library, not a string library.

[1] https://github.com/railgunlabs/unicorn/blob/master/LICENSE

hgs3··on Show HN: I built an embeddable Unicode library with MISRA C conformance
Thanks for the suggestions. I think a comparison table would be useful, but I want to make sure I do it right since I'd be comparing my work to someone else's.

As for the compilers, I’ve tested the library with GCC, Clang, and MSVC, and with the -pedantic flag like the GP mentioned. The library should build with any standard-compliant C99 compiler.

← PreviousPage 3 of 21Next →