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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Nature: Programming language to experience the joy of programming

134 点作者 psxuaw超过 1 年前

31 条评论

xwowsersx超过 1 年前
The general negativity and tone of "tell me precisely what the point of this is right now!" in the comments here deviates so completely from the spirit of play, tinkering, and experimentation inherent in the hacker ethos, at least as I see it, and I'm really disappointed to see it here. You can have your qualms with this language, you might feel personally overloaded by languages at the current moment, maybe you even have legitimate questions about the intended audience of this language — fine. None of those feelings or questions justify the kind of rude, interrogatory "How dare you do this! Show me why I should care!" attitude reflected in many of the comments here.
评论 #37877255 未加载
评论 #37877401 未加载
评论 #37877795 未加载
评论 #37877721 未加载
评论 #37877425 未加载
评论 #37878626 未加载
booleandilemma超过 1 年前
I don&#x27;t know. I feel like the language space is very crowded right now.<p>While that&#x27;s a great thing for everybody, it does mean if you&#x27;re going to be pushing a new language, you need to be clear about what sets your language apart from the dozens of others clamoring for attention.
评论 #37871900 未加载
评论 #37872322 未加载
评论 #37876362 未加载
评论 #37872652 未加载
评论 #37876883 未加载
评论 #37876123 未加载
评论 #37872892 未加载
donpdonp超过 1 年前
The syntax choices are really nice here. It has a lot of what I would pick for a language. The one-liner test cases are awesome, &lt;&gt; for generics is comfortable since I use rust, sum types like elm are awesome. If I were to add something (well take it away really) its to use whitespace for array element separators. Eliminates the whole trailing comma issue and looks cleaner, though I admit it might create parsing ambiguities. &#x27;try expr&#x27;, returning (val,err) is curious and I think I like it better already than try {} catch {}.
评论 #37875513 未加载
评论 #37876857 未加载
评论 #37872646 未加载
评论 #37876747 未加载
评论 #37874396 未加载
评论 #37878487 未加载
zoogeny超过 1 年前
I like the feel of the syntax on first glance.<p>I have been thinking recently that all of the new powerful features showing up in language (Typescrpt, Go, Rust, Elixir, Kotlin, etc.) have been exposing programmers to combinations of programming language features that were not widely available before. I mean, I grew up with Pascal, Basic, C&#x2F;C++ and Lisp but kids these days are growing up with Python, Typescript, Rust, Go, Haskel, Kotlin, Dart, Swift, C#.<p>Specifically I was thinking about how I avoid classes now for almost all of my code. I used to be a OOP first guy. Now I want value semantics and abstract data types. I have always hated exceptions (or any non-local control flow in general) and I love guards and defer-like semantics. I love the idea of CSP and Erlang but I also want full low-level control of bits. I want custom allocators and no GC, except maybe when I want a GC for some reason.<p>I love that people are just experimenting by taking the bits and pieces they like from the multitude of available high-quality languages and they are mixing them up into strange new soups.
评论 #37871955 未加载
评论 #37878501 未加载
评论 #37877022 未加载
johngossman超过 1 年前
There is a 1963 RAND paper where they considered whether it was time to standardize on a programming language (Not yet, was their conclusion). It contains one of my favorite quotes: “About the same time, however, a further complicating factor arose--the designing of programming languages became fashionable. Now the proliferation of languages increased rapidly as almost every user who developed a minor variant on one of the early languages rushed into publication, with the resultant sharp increase in acronyms. In addition, some languages were designed practically in vacuo. They did not grow out of the needs of a particular user, but were designed as someone&#x27;s &quot;best guess&quot; as to what the user needed (in some cases they appeared to be designed for the sake of designing).”<p>Personally, I find nothing wrong with designing for the sake of designing.
评论 #37877054 未加载
munro超过 1 年前
A pleasant little language, it looks like weiwenhao started working on it back in 2021. It looks great!<p>I couldn&#x27;t find anything novel the programmer wanted to try out in this language-- seems like they just want to capture the zeitgeist, and condense it into a simpler form.<p>It does make me wonder, how many other interesting languages are programmers toiling on out there? Wish there was a way to sort by newest repo, but this does start revealing some interesting underground langs:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;topics&#x2F;programming-language?o=desc&amp;s=updated">https:&#x2F;&#x2F;github.com&#x2F;topics&#x2F;programming-language?o=desc&amp;s=upda...</a>
lifeisstillgood超过 1 年前
I have a joy of programming in <i>bash</i>. Another language might be fun but the real joy lies in expressing oneself, solving a problem, getting the <i>bon mot</i> - its past bedtime and I have for the first time in a year found myself doing salaried work after hours for the fun of it
评论 #37877076 未加载
评论 #37877012 未加载
评论 #37878583 未加载
dindobre超过 1 年前
Allow me a shallow opinion since we are in &quot;joy of programming&quot; territory: after python anything with curly brackets feels &quot;uh&quot;. Give me python with typescript typing
评论 #37872202 未加载
评论 #37872191 未加载
评论 #37872347 未加载
评论 #37878432 未加载
评论 #37872274 未加载
twism超过 1 年前
In the &quot;Error Handle&quot; example ...<p><pre><code> 11 var t = test { ---------------------------------------------</code></pre> Should the variable `t` be `foo` here?<p><pre><code> --------------------------------------------- 12 list = [1, 2, 3, 4, 5] 13 } 14 15 var (l, err) = foo.list[8]</code></pre>
评论 #37872909 未加载
gsuuon超过 1 年前
This is cool - it looks like there are a few languages developed targeting game development, like Odin and Jai. Are there others in this space? Really curious how these compare.<p>It doesn&#x27;t look like Nature has ADT&#x27;s, is that true or just missing from the docs?
Willamin超过 1 年前
A bit of a nitpick on the language on the homepage:<p>The description of the Fibonacci example seems incorrect, but I might be misunderstanding something about the language.<p>&gt; A fib evaluation function was defined using recursion.<p>&gt; The result of the function call was assigned to a variable named &quot;result&quot; and format the output using fmt.printf<p><pre><code> import fmt fn fib(int n):int { if n &lt;= 1 { return n } return fib(n - 1) + fib(n - 2) } fmt.printf(&#x27;fib result is %d&#x27;, fib(30)) </code></pre> No variable named &quot;result&quot; is ever defined, right? Maybe the description is outdated from a time when an intermediate variable was present.
评论 #37872020 未加载
评论 #37872033 未加载
评论 #37871939 未加载
agentultra超过 1 年前
Depends on what brings you joy.<p><i>Update</i>: Ok, non-glib serious comment: the &quot;joy&quot; of programming is highly subjective and the author might want to consider a different byline to avoid confusion. A &quot;creative&quot; or &quot;hobby&quot; programming lanugage for &quot;experimentation,&quot; might make the point better.<p>Personally I don&#x27;t find much joy in C-like languages as they&#x27;re all approximately the same to me... and the &quot;joy of programming,&quot; is less about syntax than semantics and form.
评论 #37872068 未加载
billfruit超过 1 年前
How exactly does it make someone experience the joy of programming?
评论 #37872111 未加载
评论 #37871917 未加载
ejstembler超过 1 年前
Congratulations weiwenhao! I like what I see so far and am looking forward to following the continued development of the language. Do you have any social media accounts set up for the language (e.g. X, Mastodon, Blue Sky, etc.) that people can follow?
评论 #37877820 未加载
teo_zero超过 1 年前
I find this promising. There are some weak points to highlight (not to criticize, but to help development).<p>What I don&#x27;t like is that there are more ways to declare what a name means. Variables:<p><pre><code> var x = ... int x = ... </code></pre> And even functions:<p><pre><code> fn f()... var f = fn()... </code></pre> It makes reading someone else&#x27;s code difficult. When I want to know what an identifier is, I scan the code until I find its declaration. I might do it manually or via some macros of my editor, but the fact that such declaration can appear in different forms makes things difficult.<p>Besides, looking for the first time at a piece of code it&#x27;s not immediately clear if an identifier is a type or a variable. Especially in constructs where a variable and a type appear separated by a =, which suggests they are of the same kind:<p><pre><code> var box = rectangle {... </code></pre> My personal preference to solve the two issues in one go would be to use : to mark the type (which could be omitted in case of auto inference) and make &#x27;var&#x27; mandatory:<p><pre><code> var x : u8 = 27 var y : = &#x27;hello&#x27; var f : fn(int)-&gt;int = { </code></pre> With : repurposed, it can&#x27;t be used for the return type; I used -&gt; as in other languages.<p>Now a macro or reader looking for the declaration of x, y or f knows exactly what to look for. Now types can only appear after a : or the keywords &#x27;type&#x27; and &#x27;as&#x27; (unless the syntax of the latter elements is changed to &#x27;type:&#x27; and &#x27;as:&#x27;).<p>And talking about &#x27;as&#x27;, its priority must be clarified:<p><pre><code> z = a * -b as int </code></pre> Does &#x27;as int&#x27; apply to b, to -b, to the whole product, or to z?<p>I like how easy it is to declare union or sum types with &#x27;|&#x27;, but the need to use &#x27;as&#x27; and &#x27;let&#x27; after an &#x27;if ... is&#x27; makes it clumsy. Lazy programmers, the ones that wouldn&#x27;t check for NULL in C, will simply add a &#x27;let&#x27; here and there and perpetrate Tony hoare&#x27;s billion-dollar mistake.<p>Finally, I&#x27;d like to understand exactly how the parser handles new lines. It looks like they end a statement, but are ignored in other contexts.
TeaDude超过 1 年前
In-house non-llvm compiler? Ooh! This looks fun!<p>Will definately give this a peruse.
评论 #37872135 未加载
twism超过 1 年前
Man i don&#x27;t know ... if things are not strictly immutable (or at least by default) i&#x27;m not so sure about the joy part.
dvektor超过 1 年前
Looks like the love child of Python and Go.<p>I like the syntax.
joshbuckler超过 1 年前
weiwenhao: The example in <a href="https:&#x2F;&#x2F;nature-lang.org&#x2F;docs&#x2F;the-basics&#x2F;function#multiple-return-values" rel="nofollow noreferrer">https:&#x2F;&#x2F;nature-lang.org&#x2F;docs&#x2F;the-basics&#x2F;function#multiple-re...</a> has `balance` and `product` swapped.
评论 #37872469 未加载
spinal超过 1 年前
I really like the syntax around error handling. It is similar to the usual try&#x2F;catch, but looks <i>a lot</i> cleaner (at least to me, coming from Go).<p>Was this inspired by another language? I don&#x27;t recall seeing a language with the same (or very similar) syntax.
评论 #37879337 未加载
endorphine超过 1 年前
By reading the title, I expected this to be targeted towards newcomers to programming and hence be more close to Ruby (no types, reads like English etc)
FrustratedMonky超过 1 年前
Just quick take from the code examples.<p>How is this more joyful than Rust Or Java or anything?<p>What is the key difference here that is about adding &#x27;joy&#x27;?<p>Just not picking up on the sales case.
评论 #37871595 未加载
hamdouni超过 1 年前
Nice to see another language with different approaches... I will check it as it is always interesting to challenge its knowledge
raytopia超过 1 年前
I like it. I&#x27;m going to give it a try.
klausnrooster超过 1 年前
Glad to see things like this. Think Phix is contender in the space. 100% RosettaCode coverage in 2021.
sjm超过 1 年前
Sometimes I think we need more verbosity in programming languages. Imagine you&#x27;re new to programming and come across this,<p>- what the hell is fmt? - what the hell is fn? - int? - n? - printf? what is f? - what is %d?<p>I know this probably isn&#x27;t the crowd for this, but if my non-programmer friends curious about learning to code saw this they&#x27;d run for the hills. Sure this isn&#x27;t a &quot;learn to code&quot; language, but a little verbosity is IMO not a bad thing: it is more humanist and can be self-documenting.
评论 #37872297 未加载
评论 #37876338 未加载
评论 #37872511 未加载
fyzix超过 1 年前
Any eta on a json module?
mock-possum超过 1 年前
Reminds me of typescript, less parenthesis, and prefix typing.
pif超过 1 年前
The question I didn&#x27;t find answered in their documentation: why?
评论 #37872935 未加载
riidom超过 1 年前
Is Unicode support on the todo list?
Vaslo超过 1 年前
It just looks like another programming language that I would waste time on instead of learning languages with tons more support and user acceptance that don’t look much different.<p>Let’s keep reinventing the wheel!
评论 #37877191 未加载
评论 #37882576 未加载