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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: I built a programming language, inspired by Golang

7 点作者 weiwenhao9 天前
Hello, I&#x27;m the author of the nature programming language, which has reached an early usable version since its first commit in 2021 until today.<p>---<p>Why implement such a programming language?<p>go is a programming language that I use for my daily work, and the first time I used golang, I was amazed by its simple syntax, freedom of programming ideas, ease of cross-compilation and deployment, excellent and high-performance runtime implementations, and advanced concurrency style design based on goroutine, etc. But, golang also has some inconveniences<p>- The syntax is too concise, resulting in a lack of expressive power.<p>- The type system is not perfect<p>- Cumbersome error handling<p>- The automatic GC and preemptive scheduling design is excellent, but it also limits the scope of go.<p>- Package management<p>- interface{}<p>- ...<p>nature is designed to be a continuation and improvement of the go programming language, and to pursue certain differences. While improving the above problems, nature has a runtime, a GMP model, an allocator, a collector, a coroutine, a channel, a std, and so on, which are similar to those of go, but more concise. And nature also does not rely on llvm, with efficient compilation speed, easy cross-compilation and deployment.<p>Based on the features already implemented in the nature programming language, it is suitable for game engines and game development, scientific computing and AI, operating systems and the Internet of Things, the command line, and web development.<p>When nature is fully featured and optimized, it is expected that nature will be able to replace golang in any scenario (converting to readable golang code, using nature with minimal trial-and-error costs, and switching back to golang at any time). And as a general-purpose programming language, nature can compete with any other programming language of its type. [Note that this is not yet complete.]<p>---<p>I know, it&#x27;s a little late, I spent too much time, just to bring another programming language, after all, the world is not short of programming languages. But when I really think about questions like &quot;Should I continue? Can I do it well?&quot;, I realized I had already come a very, very long way.<p>---<p>Feel free to give me feedback, I&#x27;ll answer any questions you may have.<p>Website: <a href="https:&#x2F;&#x2F;nature-lang.org" rel="nofollow">https:&#x2F;&#x2F;nature-lang.org</a> The home page contains some examples of syntax features that you can try out in the playground.<p>Get started: <a href="https:&#x2F;&#x2F;nature-lang.org&#x2F;docs&#x2F;get-started" rel="nofollow">https:&#x2F;&#x2F;nature-lang.org&#x2F;docs&#x2F;get-started</a> contains a tutorial on how to install the program and advice on how to use it.<p>Syntax documentation: <a href="https:&#x2F;&#x2F;nature-lang.org&#x2F;docs&#x2F;syntax" rel="nofollow">https:&#x2F;&#x2F;nature-lang.org&#x2F;docs&#x2F;syntax</a><p>Playground: <a href="https:&#x2F;&#x2F;nature-lang.org&#x2F;playground" rel="nofollow">https:&#x2F;&#x2F;nature-lang.org&#x2F;playground</a> Try it online<p>---<p>Contribution Guide<p><a href="https:&#x2F;&#x2F;nature-lang.org&#x2F;docs&#x2F;contribute" rel="nofollow">https:&#x2F;&#x2F;nature-lang.org&#x2F;docs&#x2F;contribute</a> I have documented how the nature programming language is implemented.<p>nature has a proprietary compiler backend like golang, but the structure and implementation of the nature source code is very simple.<p>This makes it easy and fun to contribute to the nature programming language. Instead of just a compiler frontend + llvm, you can participate in SSA, SIMD, register allocation, assembler, linker, and other fun tasks to validate your learning and ideas. You can express your ideas through github issues and I&#x27;ll guide you through the contribution process.<p>---<p>These are some of the smaller projects I&#x27;ve implemented with nature, and I really like the feel of writing code with nature.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;weiwenhao&#x2F;parker">https:&#x2F;&#x2F;github.com&#x2F;weiwenhao&#x2F;parker</a> Lightweight packaging tool<p><a href="https:&#x2F;&#x2F;github.com&#x2F;weiwenhao&#x2F;llama.n">https:&#x2F;&#x2F;github.com&#x2F;weiwenhao&#x2F;llama.n</a> Llama2 nature language implementation<p><a href="https:&#x2F;&#x2F;github.com&#x2F;weiwenhao&#x2F;tetris">https:&#x2F;&#x2F;github.com&#x2F;weiwenhao&#x2F;tetris</a> Tetris implementation based on raylib, macos only<p><a href="https:&#x2F;&#x2F;github.com&#x2F;weiwenhao&#x2F;playground">https:&#x2F;&#x2F;github.com&#x2F;weiwenhao&#x2F;playground</a> playground server api implementation<p>---<p>Lastly, I&#x27;m looking for a job, so if you think this project is okay, I hope you&#x27;ll give me a star, it would help me a lot

1 comment

pancsta8 天前
Id personally appreciate a more complex version of Go, which compiles to plain Go, especially richer types for modeling business logic in places where its beneficial. Your lang may be inspired by Go, but it does not use the Go platform nor toolchain, correct?
评论 #44073058 未加载