Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
nikki93
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
31.
▲
by
nikki93
5y ago
I actually tried D as part of this exploration. I forget but it was confusing which of dmd or the llvm one to use, and ultimately the language ergonomics were not that much of an improvement over C++. Like "auto" is still super we
32.
▲
by
nikki93
5y ago
Yup, pretty much. I do think that "GC" usually these days refers to a mark and sweep GC (certainly in the context of a discussion about Go?) or at most a refcount kind of thing applied to all reference-like language entities, not
33.
▲
by
nikki93
5y ago
I'll read your statement as a question and answer that. I was using C++ for data-oriented gameplay coding, and I was interested in exploring making a language frontend that compiles to it to clean it up, as a side project (lots of dark
34.
▲
by
nikki93
5y ago
I've written my own Go (subset + extensions) -> C++ transpiler and using it on a game project: https://www.youtube.com/watch?v=8He97Sl9iy0 -- No GC, it does have slices and has access to an entity/component API
35.
▲
by
nikki93
5y ago
"Starting Forth" and "Thinking Forth" may be good books (the latter is kinda more architecture / philosophy though).
36.
▲
by
nikki93
5y ago
Not saying this means you actually need to add constructors and destructors, but I think the main tricky bit is when you have eg. a grow / shrinkable array and want to call something on it that removes elements and it should be calling
37.
▲
by
nikki93
5y ago
Pooling is indeed what the ECS I use (entt) basically does--every component type has a contiguous pool of instances. Compiling Go to C++ lets me use entt among other things (target all of C++'s targets including Wasm, have some types o
38.
▲
by
nikki93
5y ago
Yeah the Go -> C++ compiler I linked from my other comment is pretty much overlapping with this idea. TinyGo is still a bit early afaict and also tries to exactly implement Go semantics but I'm kind of interested in extending /
39.
▲
by
nikki93
5y ago
I think the main thing is it starts to become a distraction from just writing the gameplay code. I don't have to implement the pooling stuff now that I have this compiler--naive / simple code tends to also start off with a high pe
40.
▲
by
nikki93
5y ago
I've been working on a Go -> C++ compiler pretty much mainly for this use case, that skips the GC and concurrency stuff -- https://www.reddit.com/r/golang/comments/r2795t/i_wrote_a_si... -- Inclu
41.
▲
by
nikki93
5y ago
Have you compared the performance and generated binary size of C vs. Go on WebAssembly?
42.
▲
by
nikki93
5y ago
One of the newer (newer than C, C++, Common Lisp, ...) languages I feel comfortable about regarding this is Go. Definitely feels like I can write a simple Go program to generate a static website for example and it'll probably still wor
43.
▲
by
nikki93
5y ago
Nice! This is definitely my main usecase for reflecty things lately, along with serialization for the data (game engine scenarios). I've been doing static reflection + attributes through this: https://godbolt.org/z/
44.
▲
by
nikki93
5y ago
When I've tried it out for wasm game development, the biggest issue I had was frequent GC pauses (was a few every second) causing frame drops. TinyGo gets at this issue. I've used C++ since then, focusing on a small subset that ke
45.
▲
by
nikki93
5y ago
Thank you! We also have a Discord server (link at bottom of website) -- the app is rough around the edges still and some support / inspiration usually helps.
46.
▲
by
nikki93
5y ago
There's also NerdSEQ: https://xor-electronics.com/nerdseq/ + actual Eurorack modules! :D I like the Ableton clip style main view in NerdSEQ which allows you to live mix and match patterns, haven't come across
47.
▲
by
nikki93
5y ago
Ah yes that would also be an issue!
48.
▲
by
nikki93
5y ago
This may be due to requiring WebGL 2 specifically, and not WebGL generally.
49.
▲
by
nikki93
5y ago
Figma uses webassembly. We also use it for our web engine at https://castle.xyz , I gave at talk about that you can watch here: https://youtu.be/0FjCaoc1uzs where I go into some details and also do some live wasm
50.
▲
by
nikki93
5y ago
Would be nice to see a short screencast or at least a screenshot giving a sense of the workflow this enables (or maybe I'm missing it on the site -- looking at it on mobile).
51.
▲
by
nikki93
5y ago
FWIW, the overhead of calls across the cgo barrier is quite high, which can have API architecture implications -- https://github.com/dyu/ffi-overhead#results-500m-calls .
52.
▲
by
nikki93
5y ago
The tradeoff would be different in an embedded context, for sure. I don't know that cJSON being worse due to not supporting allocators is "ironic," it's just the tradeoff there. Compile time actually really matters to my
53.
▲
by
nikki93
5y ago
Yeah the support for pointer / patch etc. is a definite plus. The customization point thing I tend to do with my own customization points, but it's pretty good if a bunch of libraries settle on a standard customization point (eg.
54.
▲
by
nikki93
5y ago
The API side of this library is pretty good. I've generally avoided it due to the compile time, and preferred rapidjson due to both better performance and compile time if I wanted a C++ API, or cJSON if a C API is fine and I really jus
55.
▲
by
nikki93
5y ago
I do think that in practice a hierarchical ontology like that is still best not modeled as a language-level hierarchy because the language inheritance / hierarchy concepts are often not the exact semantic you want, IME. Esp. if it then
56.
▲
by
nikki93
5y ago
I don't think ECS necessarily means a "build the world" approach. I think it's best kept at the level of a data structure with some given set of operations: create entity, destroy entity, add component to entity, remove
57.
▲
by
nikki93
5y ago
It depends on the storage pattern: archetype storages may actually keep those components together / interspersed anyway, or hybrid things like the "groups" in entt. It does, generally speaking, just seem to give you an opport
58.
▲
by
nikki93
5y ago
The performance / cache-orientation point gets talked about a lot re: ECS, but IME there are also (and maybe moreso) other important benefits: - Combined with an inspector UI, you can explore gameplay by adding and removing components
59.
▲
by
nikki93
5y ago
I don't think it's "too much work" if you really need it or are really interested in doing so and the approach results in incremental benefit vs. one big blob of benefit at the end. It would be quite a bit of work and no
60.
▲
by
nikki93
5y ago
Love does work through wasm in the pure C++ approach, have been using it on a project for a bit now. It's definitely better that way vs. also using Lua since you can't use LuaJIT and vanilla Lua running in wasm esp. with a GC isn&
More ›