TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Accidentally making a language, for an engine, for a game

356 点作者 markdog12大约 3 年前

30 条评论

Centigonal大约 3 年前
I don&#x27;t know what it is about game development that really brings out the yak shaving in people.<p>One time, about 8 years ago, I backed a game called Nowhere[1] by a very talented programmer. The original premise was an alien life simulator.<p>Well, it&#x27;s been eight years, and development is still going strong!<p>The developer is currently working on the String implementation for the programming language he invented[2], which he&#x27;s using to write the other programming language he invented[3], which is eventually going to be used to write the game.<p>[1] <a href="https:&#x2F;&#x2F;duangle.com&#x2F;nowhere" rel="nofollow">https:&#x2F;&#x2F;duangle.com&#x2F;nowhere</a><p>[2] <a href="https:&#x2F;&#x2F;hg.sr.ht&#x2F;~duangle&#x2F;scopes" rel="nofollow">https:&#x2F;&#x2F;hg.sr.ht&#x2F;~duangle&#x2F;scopes</a><p>[3] <a href="https:&#x2F;&#x2F;hg.sr.ht&#x2F;~duangle&#x2F;tukan" rel="nofollow">https:&#x2F;&#x2F;hg.sr.ht&#x2F;~duangle&#x2F;tukan</a>
评论 #30916456 未加载
评论 #30915907 未加载
评论 #30917254 未加载
评论 #30916364 未加载
评论 #30917297 未加载
评论 #30915607 未加载
评论 #30916179 未加载
评论 #30915625 未加载
评论 #30915740 未加载
评论 #30919867 未加载
评论 #30916539 未加载
评论 #30933160 未加载
评论 #30922529 未加载
评论 #30922904 未加载
评论 #30920964 未加载
评论 #30927019 未加载
评论 #30916670 未加载
评论 #30916695 未加载
评论 #30920925 未加载
评论 #30916335 未加载
Townley大约 3 年前
It&#x27;s interesting that this phenomenon is much more prevalent in game development, as opposed to (for example) web development: some people build their own web development frameworks, but it seems like every game dev tries to make an engine at some point.<p>My theory why: good web frameworks consider developer experience to be of paramount importance, and invest heavily into examples, documentation, and API improvements. Unreal and Unity by comparison are unpleasant to work in. The UI is clunky, the examples cap out after a certain point of complexity, and community input is almost nothing when compared to the Django, Express, Rails, or language-specific ecosystems.<p>Anyway, I can&#x27;t say I&#x27;ve ever made it far enough down the rabbit hole to want to make my own language... but I know for me, the desire to make my own engine* has punctuated every attempt over the years to get better at both Unity and Unreal<p>*Acknowledgment that I might be partially disproving my own point, as I&#x27;ve tried to build both my own web framework, AND my own game engine... but I spent a lot more time on the game engine (<a href="https:&#x2F;&#x2F;github.com&#x2F;RobertTownley&#x2F;gamehook" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;RobertTownley&#x2F;gamehook</a>)
评论 #30915429 未加载
评论 #30915271 未加载
评论 #30915497 未加载
评论 #30915189 未加载
评论 #30916616 未加载
评论 #30916763 未加载
评论 #30915685 未加载
评论 #30916191 未加载
评论 #30915123 未加载
评论 #30916980 未加载
评论 #30915567 未加载
评论 #30919032 未加载
评论 #30915260 未加载
verdagon大约 3 年前
Always a pleasant surprise to be scrolling through HN and seeing one of my articles on the front page!<p>For anyone interested in how that code would get zero memory safety overhead without the classic borrow checker, a big part of it is because of the &quot;region borrow checker&quot; [0]. There are some other factors (iso regions, hybrid-generational-memory, etc.) but region borrow checking is the big one.<p>[0] <a href="https:&#x2F;&#x2F;verdagon.dev&#x2F;blog&#x2F;zero-cost-refs-regions" rel="nofollow">https:&#x2F;&#x2F;verdagon.dev&#x2F;blog&#x2F;zero-cost-refs-regions</a>
评论 #30914665 未加载
评论 #30917344 未加载
评论 #30920907 未加载
评论 #30917437 未加载
评论 #30914898 未加载
mathgladiator大约 3 年前
There should be a competition of yak shaving.<p>I&#x27;ve writing a Rust based canvas engine, with content via my own IDE, the runtime is fed data via WebSocket using my own API protocol, web proxy routing through a streaming and distributed load balancer using a new protocol, landing on my back-end platform running my own language, writing deltas to my own data store. <a href="https:&#x2F;&#x2F;www.adama-platform.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.adama-platform.com&#x2F;</a><p>Why? For board game glory!
评论 #30915019 未加载
评论 #30915172 未加载
评论 #30915456 未加载
评论 #30915838 未加载
SeasonalEnnui大约 3 年前
For any comparison to C# (it being slower or having GC pauses), it probably doesn&#x27;t take into account the latest advances (.NET 6). That&#x27;s understandable given there isn&#x27;t really incentive to gain a mastery in every language during a comparison.<p>With regards to C#&#x2F;.NET 6, it is now easy to:<p>- Have zero-allocation code through the whole stack, making garbage collection zero&#x2F;near-zero. [Span&lt;T&gt;, Memory&lt;T&gt;]<p>- Distribute platform specific all-in-one binaries with no unbundling&#x2F;uncompression or need to install any runtime. [dotnet publish -r win-x64 -c Release -p:PublishSingleFile=true -p:PublishTrimmed=true]<p>- For hot-path optimisation (many available profiling tools), dive into new high-performance APIs such as CPU vector intrinsics, or native memory allocation (aligned or unaligned). [System.Runtime.Intrinsics.X86, System.Runtime.InteropServices.NativeMemory]<p>- For faster startup times: AOT compilation. (Not necessarily faster at runtime in general; JIT has advantages there with being able to detect hot paths)<p>These are just the features I&#x27;ve used, there are doubtless many more. In the future .NET 7, it will be possible to disable runtime marshalling so interop calls to C DLLs have no overhead (along with a compile-time analyzer to throw errors if the types you&#x27;re using are not compatible, aka &#x27;blittable&#x27;).<p>Credit to Vale - it appears to be addressing all these things so there&#x27;s certainly an interesting future ahead.
评论 #30917580 未加载
Nijikokun大约 3 年前
It&#x27;s unfortunate that the majority of comments are centered around Yak Shaving rather than the amazing leaps that this small language has done.
评论 #30917636 未加载
评论 #30916863 未加载
评论 #30918294 未加载
ncmncm大约 3 年前
That just seems like poor discipline.<p>But not like creating a typesetting system to use to write your book.<p>It seems like it is shaping up to a pretty nice language. But writing the compiler in itself is very 20th-century. Just add a parser to LLVM or Gcc and call it good.<p>But don&#x27;t make the mistake C, C++, and Rust did, using a prefix dereference operator. Pascal got that one right.<p>BTW: &quot;get&quot; in a pure function name is code smell. More generally, transitive verbs in pure function names are code smell.
评论 #30914953 未加载
评论 #30916391 未加载
评论 #30915437 未加载
评论 #30915502 未加载
评论 #30925707 未加载
ReactiveJelly大约 3 年前
Hey, making games isn&#x27;t my job, so I&#x27;m just as happy making OpenGL demos instead of games.<p>&gt; It&#x27;s like I&#x27;ve been driving a Honda Civic in city traffic, and now I&#x27;m in a BMW cruising down the highway.<p>There&#x27;s a certain satisfaction in doing my own thing, even if it&#x27;s crappy. Like Gilfoyle&#x27;s electric car in &quot;Silicon Valley&quot;.
klabb3大约 3 年前
The way structured concurrency is implemented in Vale is exactly what I&#x27;ve been missing in every language I&#x27;ve been working, including Rust which gets pretty close. Amazing job!
评论 #30915500 未加载
评论 #30917148 未加载
andrewflnr大约 3 年前
AHA! I should have known that generation-reference business was intended for games all along.<p>Reminds me of the time the FoundationDB team wrote a compiler to write a simulator to test their database: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=4fFDFbi3toc" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=4fFDFbi3toc</a>
RugnirViking大约 3 年前
We did this for Patafour <a href="https:&#x2F;&#x2F;github.com&#x2F;OwocekTV&#x2F;V4Hero" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;OwocekTV&#x2F;V4Hero</a><p>Hasn&#x27;t gone quite as far as making our own language, we did it all in c++. For us we know doing things this way is a vastly more difficult approach, but nonetheless we plough on. Yesterday I was learning how bezier curves work so we can animate wind effects. The list of interesting maths and physics problems to solve are endless but oh so satisfying, and ultimately its a hobby not something we sell for money.
jokoon大约 3 年前
I decided to use Godot to make a lowpoly online FPS, I don&#x27;t think it&#x27;s a great choice, but I&#x27;ve read good things about godot networking...<p>I first wanted to make it in C++ and opengl, and it did not look like a difficult thing to do, but godot is good enough for a lot of things, it&#x27;s small, and it allows me to do multiplatform, which is such a big bonus, since C++ is never easy to use on several platforms.<p>I have no idea if I will be able to implement network prediction with godot.
评论 #30921020 未加载
ffhhj大约 3 年前
If someone had told me the second part of that mantra: &quot;... but don&#x27;t make a game, make an MVP and check with your friends if the game mechanics are fun, first!&quot;
RandyRanderson大约 3 年前
In the limit, every configuration file becomes turing complete.
cmrdporcupine大约 3 年前
Being distracted building tooling and frameworks is one of the harder things I find with personal projects.<p>In paid $work, there is a) an imposed direction and usually a schedule from a customer b) often a team of people to distribute work to, and to help keep one disciplined.<p>Example: I&#x27;m writing a VST synthesizer, virtual instrument, as a personal project in my time off between jobs. Maybe I&#x27;ll make it commercial someday, not sure. I became increasingly frustrated with the half-assed portable GUI toolkit bundled with the VST3 SDK (&quot;VSTGUI&quot;). There&#x27;s a complete lack of decent cross platform UI options that will work in this context (QT won&#x27;t do it here, for reasons.)<p>I realized that there&#x27;s already a cross platform UI option with millions of man hours put into it: the web. So I have spent the last three or four weeks writing a bridge to embed Edge-Chromium, WebKit, etc. Have that working on Win32, at least (still have to do the work for Linux &amp; Mac, but ok).<p>Then on to actually making the UI in this platform. Now I&#x27;m learning npm, webpack, TypeScript.<p>Need a nice little HTML&#x2F;CSS knob for my UI. Most are bundled in a giant framework I don&#x27;t want. Oh, here&#x27;s one in pure JS. But, hm. I think I&#x27;ll refactor this into Typescript. Now it&#x27;s forked, just for me.<p>Ok, well, yes I have that mostly working. Some warts, but basically is very similar to the &quot;native&quot; (VSTGUI) UI I had before. But now I want to write a graphical envelope editor. Off to learn HTML Canvas drawing.<p>Many parts of this whole process could themselves be spun off into separate projects, that I could spend years maintaining, on their own.<p>And so it goes. The Yak is pretty shaved at this point.
didip大约 3 年前
Scala for a game engine seems like an odd choice. What was the initial decision to choose it?<p>Also, how’s the compile time? If it’s too long won’t it drive you crazy?
评论 #30914844 未加载
评论 #30914849 未加载
sriku大约 3 年前
This reminded me of a statement David Zicarelli (creator of Max&#x2F;MSP&#x2F;Jitter) made many years ago - that he originally started working on Max in order to make a tool to help him compose novel and interesting music, and then he got so drawn into making the tool that he lost interest in the music composition itself. If we&#x27;re to call Max&#x2F;MSP&#x2F;Jitter &quot;yak shaving&quot;, it is a shining star of it since so many artists - both visual and sonic - build their work on it.<p>The other obvious one is Knuth - inventing TeX and Metafont and Computer Modern typefaces so he can write his books the way he wants to. Another shining star.
Jyaif大约 3 年前
&gt; We&#x27;re adding a parallel keyword<p>Why is there a need for a &quot;parallel&quot; keyword? Can&#x27;t the compiler decide for you whether to parallelize a loop for you?<p>If the decision to parallelize depends on the data, couldn&#x27;t the compiler generate code for both implementations and select the right one at run time?<p>Or maybe the programmer could describe in code what they expect the data will look like, and the compiler will take a decision based on those annotations (and other signals, such as the HW the program has access to, what the programmer wants to optimize for (memory? latency?)).
mamcx大约 3 年前
The other niche where this kind of thing happens: ERP&#x2F;eCommerce applications.<p>And at least from my POV, is where it ACTUALLY need it, not just is fun.
Magnusmaster大约 3 年前
Vale looks very interesting and I hope it takes off
ryukoposting大约 3 年前
How timely! I&#x27;m sketching out a visual novel engine that implements a simple DSL (think of it like Ren&#x27;Py, but with Ruby instead of Python). Yesterday, I spent hours rewriting the line-by-line preprocessor into an LR parser.<p>Oh, and I had to write my own FFI library to bind into the MRI.<p>Oh, and the language I&#x27;m using has an SDL2 library available, but it was incomplete the last time I checked.<p>Fun!
wiz21c大约 3 年前
FTA :<p>&gt; So, having learned that lesson thoroughly, I then made the same mistake again!<p>So true ! I don&#x27;t know if it is written with a bit of sarcasm, but this one made me laugh !<p>&#x27;cos in the end, it&#x27;s about doing what one loves. So if you think you like to make games but have fun writing the perfect game engin instead, it&#x27;s not less fun !
vsroy大约 3 年前
What are some of the interesting tradeoffs this language has made? Ideally with super small code samples
评论 #30916605 未加载
pjmlp大约 3 年前
&gt; These languages are mostly fine... but C# is slow,....<p>First of all, it is a matter of which implementation we are talking about.<p>Second, all major implementations wouldn&#x27;t have had any issue dealing with the demos shown on the blog.<p>I guess it was a good learning process about compilers for the author.
评论 #30915733 未加载
arduinomancer大约 3 年前
I don’t get why are programmers so obsessed with the tools they use for the job?<p>More than any profession
评论 #30915031 未加载
评论 #30916067 未加载
评论 #30916630 未加载
评论 #30915122 未加载
评论 #30915022 未加载
评论 #30915151 未加载
评论 #30917382 未加载
评论 #30915070 未加载
评论 #30920638 未加载
UltraViolence大约 3 年前
Glossing over the language it seems very similar to Rust, but with a somewhat friendlier syntax that&#x27;s closer to C#&#x2F;C++.<p>So, I&#x27;m wondering if and when someone will write an operating system in it.
评论 #30918990 未加载
quickthrower2大约 3 年前
Maybe I would make a good game dev after all: I have no interest in making a language, would be happy knocking one up in JS
评论 #30916265 未加载
IYasha大约 3 年前
Ahh, 1337 A.D. What a year!
throwaway81523大约 3 年前
Greenspun&#x27;s 10th law?
empgodot大约 3 年前
I hate when that happens.