Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Nature: Programming language to experience the joy of programming (nature-lang.org)
134 points by psxuaw on Oct 13, 2023 | hide | past | favorite | 123 comments


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.


Adding my two cents of positivity:

I love seeing language projects that implement their own compiler backends. There really aren't enough of these around. Anything that helps bridge the knowledge gap between newbies and production grade compilers is a net positive in my books.

And extra brownie points for writing it in C. Think whatever about memory safety and language age but C code is abundantly explicit about what's going on with the code, which is something I really appreciate when approaching some new code to learn stuff.


I think it's pretty fair to ask the question of "why should I use this?" I don't think it's rude to ask what this offers over other systems languages like Rust, Nim, Zig, or Go. All of those languages have been around for a while now and have some ecosystem and inertia. This language is claiming to bring back the joy of programming but frankly it looks like another c like language. Do we really need that?

It's an impressive project for one person to make but if we're talking about it as a prospective general purpose language, that naturally invites comparisons and criticism. I haven't read the comments but I think most people have good intentions when they share their view on this project and aren't personally attacking the author.


I have no problem with genuine questions like "Who do you think should or would use this?" That's not what I'm addressing.


Most of the discussion here is fairly constructive or supportive. There are snarky and sarcastic ass holes everywhere on the internet, and especially on hackernews. The best thing you can do as a creator is learn to take the constructive feedback and ignore the noise of sad people just trying to take a pot shot at your expense. I don't think we need to explicitly call that out here.

The author mentioned in another comment that he was designing the language to use what he likes from other languages and for writing his own game engine. That's a really cool project, and I think he would get a more positive response to his language if he was up front about that on his website. The joy of programming is pretty subjective and the use cases he presents are basically possible to do in any turing complete language.

I saw another language project on hacker news about neo haskell that was some random guy trying to become the benevolent dictator for life of the haskell ecosystem without really talking to anyone in that community. I think stuff like that makes people jaded and cynical (and rightly so in some cases) when folks make overbroad claims about tools that have well established alternatives or existing communities. Not trying to excuse the behavior but that might be part of why people are biased to be negative in cases like these.


> neo haskell that was some random guy trying to become the benevolent dictator for life of the haskell ecosystem

No, he was trying to become BDFL of his own project! And why not?


His own project was seeking to replace haskell lol


What also pisses me off is fake excessive positivity. If there are genuine things that are bad or negative people should feel free to voice those opinions even if it hurts someones feelings.

Facts and truth are more important then feelings. We shouldn't lie or be fake just to cater to someones feelings. Ultimately the truth is better in the long term.

Because this is a real thing. Who would use this when there are other more popular languages out there that have basically the same syntax? What does this language excel at above all others ? If the author wants his language to have any chance or shot at real success he needs to address this.

If we just took your advice and didn't be negative in the spirit of "tinkering", "play" and "experimentation" then ultimately that advice is more poisonous than the negativity. You need to identify and test your product for it to be successful. Your advice is to blind him.

Seriously just looking at the web site my first thought was why wouldn't I just use python?


To answer your last question first: Nature seems to be an ahead of time compiled language with direct memory access vs. python’s being an interpreted strictly GC’d language. So the immediate conclusion would be, you would not use Python in a performer critical environment, i.e. game engine development for modern 3d video games (an area the author has commented several times is a personal use case).

Also, you are assuming some desire by the language designer to have the language be successful (whatever that may mean). One of the stated goals to raise user’s “joy” when programming. I think taking on a challenging problem and crafting a personally desired solution, and doing so well from a brief look at the implementation, is certainly something, that sounds like the kind of activity that could provide a great source of enjoyment/fulfillment/…. So a programmer developing a language they like and enjoy, then wanting to share that makes sense.

The main negatives I have seen expressed are ‘there are already too many programming languages, why add another, that’s a waste’ or ‘what is going to sell this language, the docs don’t make a big sales pitch’, etc. I have not seen any real criticism addressing the semantics and other than some mentions of significant white space vs. curly braces, I haven’t seen criticism related to the syntax.

So, if your negatives, which are so much more important than feelings or if the truths you referenced are substantive criticisms of the actual artifact, I would say lay them out and maybe have a conversation. But I don’t see anything substantial, just complaints about a person pursuing something they choose to pursue and making, what seems to be, a darn good effort in the process.


Skimming the website... that's not what I see. He'd do well to make what you said more evident. If it's for game engine development how does it access the GPU?

When I see the "Joy" of programming, honestly I don't care. Pretty much nobody cares. Just because someone says it's joyful doesn't make it joyful. This is essentially what he's saying: "Hey buddy use my generic product that exists in a thousand different forms everywhere, it makes you joyful"

That's why nobody cares. He did well by having examples of the code, he didn't do well by not stating where it excels above other languages. I left thinking it's like python with types.

>So, if your negatives, which are so much more important than feelings or if the truths you referenced are substantive criticisms of the actual artifact, I would say lay them out and maybe have a conversation. But I don’t see anything substantial, just complaints about a person pursuing something they choose to pursue and making, what seems to be, a darn good effort in the process.

If there's enough un-substantive criticism of a product it points to ineffective communication. If everyone is taking a shit on the product then it doesn't even matter if the product is good, it's still shit.

There's your conversation. If you want people to listen and have a conversation you need to effectively communicate. This site spawned a lot of criticism, so that's a problem stemming from the person STARTING the conversation.

You see what I wrote? Sounds mean right? But, personally I think it's better and more real than any advice you've given him.


I'm not entirely sure if Hacker News scoring system includes a boost for comments, but it seems that controversy and criticism are not necessarily bad things. They may actually help keep the post on the front page for a longer period of time.


Wish there were online communities without that attitude and snark but it seems nearly everywhere.


My guess is that the snark comes from unhappiness, which strongly correlates with percentage of time spent online, which strongly correlates with probability one posts.


this is most responses to anything anybody makes on here, it's a reddit-tier cesspit.


I don't know. I feel like the language space is very crowded right now.

While that's a great thing for everybody, it does mean if you'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.


I'm the creator of the Nature programming language, and I'm incredibly thrilled to see my project featured on the front page of Hacker News. I've been developing this project in my spare time; initially, I focused on building the compiler back-end, which is something I'm deeply passionate about. That alone took me roughly 3 years of part-time effort. Only in the past year have I started to design and implement the front-end of the programming language.

I'm not one to give up halfway, and even though breaking into the programming language market is exceedingly difficult, I'm still committed to investing my enthusiasm and time into making this work.

The first goal for Nature right now is to reach a minimum viable product stage. The second goal is to "stand on the shoulders of giants"(go/rust). The third goal is to incorporate more innovative ideas and possibilities.

Even if Nature doesn't gain a user base, I will still use it to build interesting things.


Hey, that’s a neat story! Genuinely, I’m not trying to be sarcastic with that- but you didn’t answer his question at all.

What’s the point? Your goal is an “MVP stage”- what is your MVP? What are the minimum requisite features that are the core features of the language, and why are they important / better than any other languages, and in what specific ways?

If the answer is just “because I like these syntax/feature choices and i just want to make a language, that’s okay- you’re allowed to do whatever you want on the internet lol- but answer the original question directly and specify it as such.

The goals “get an MVP”, “stand on the shoulders of giants” and “innovate”, mean and say literally nothing- it’s just a smash of buzzwords that says nothing about your intents. They translate literally to “I want to make my thing work”, “i vaguely want recognition for being like xyz things”, and “I want to make it have more things”

What does “make it work” mean? Why does “be popular like rust and go” matter to anyone/what does it mean for your product? Why are you talking about innovating more things when you haven’t even told us what the first thing is?

These questions aren’t meant to be mean / dismissive- you made a programming language, and that’s cool (to me at least!) I wanna know!! If you want to stand on the shoulders of giants, you have to know what you’re doing- or if you do, be able to explain it lol.


This is the first-phase goal for the Nature programming language, as outlined in the first section of the README on https://github.com/nature-lang/nature. To summarize:

- Type system, null safety, generics, and union types

- An in-house compiler/assembler/linker that is not reliant on LLVM and supports compilation for amd64, riscv64, and wasm architectures

- Non-intrusive interaction with C for efficient and high-performance development

- Progressive Garbage Collection, supporting both automatic and manual GC

- Built-in vec, map, set, and tup data structures

- Package and module management

- Function tags, closures, error prompts, runtime stack traces, and coroutines

- Integrated SSA, linear scan register allocation, reflection, and an assembler & linker

We anticipate that these key features will be completed around version 0.7.0, at which point a community-ready version will be released. By "community-ready," we mean that there will be stable and backward-compatible syntactic API support.

https://nature-lang.org/docs/prologue/release-notes Record the core features that have not yet been completed in the version release notes.


Very cool, very ambitious! I will keep my eye on this; good luck!


So zig with a gc once they get off of llvm


I just want you to know this was exactly my reaction.

I am working on a programming language, and I can tell you exactly why I’m bothering to write a whole new language, because it is based on all my frustrations spending my days writing code in other languages.

If this language is in the same space as Rust and Go, but different, even saying that (and how) might make me care about this language a little bit. My own language is compile-to-JS but not the same as TypeScript, Reason, PureScript, etc. I would never make the homepage just be marketing buzzwords. Whether I don’t care if anyone uses it or contributes, or I do care whether people take an interest in it, just being real and direct is the best approach. It feels good when someone understands why I’m doing what I’m doing and maybe cares and wants me to succeed because they also have been frustrated about the same things.

Some people aren’t trying to make something specifically new. They are starting a root beer company to make root beer that tastes like root beer, and one day maybe it will be sold in the local grocery store next to the other root beer, who knows. I always like to know if there is actually something special about this root beer or if someone just likes making root beer.


I apologize for not being clear in my previous statements. As of now, Nature does not even have a version that is community-ready. In my opinion, talking about various ideas and innovations is meaningless and deceptive if the programming language itself cannot be used by the community.

Additionally, my design philosophy is also included in the GitHub README.


ITT people thinking there has to be a point beyond “bc I like it.” Do what you like! This is a cool project.


I don't think many people are against personally motivated projects.

But it's frustrating to hear about a project, but not be able to tell who should be interested. And who it won't ring any bells for.

My take is:

1. There is a lot of personal motivation here. I.e. a productive hobby now, hopes for larger impact later.

2. "Reliable", "Concise", "Open" and the code examples suggest (to me) a collaborative cleanup of the imperative style of coding the author usually employs.

3. So not a strong new take on languages.

4. Despite references to "gaming", "science", "AI", "OS's", "IoT" and "WEB", there isn't anything I can see that brings anything special or breaks ground in those areas. Other than the "cleanup" aspect.

If there are aspects I am missing regarding point 4, it would be nice to have them described.

My suggestion would be to (in addition to the cleanup, all for that!), focus on one and only one application area for now. Find something really special to bring to it. Make these new capabilities so convenient to use that within some modest but interesting/fun scope the language has no competition. Then define the "MVP" around that, instead of lists of general programming features and areas.


Something to consider to get some attention: start a Nature leaderboard for Advent of Code in December. Lots of people who participate in AoC are looking for a new language to learn while solving each day's problems.


What was the main problem you were trying to solve with Nature? What did you find missing in other languages that motivated you to create Nature?


After the MVP (Minimum Viable Product) version of Nature is released, I plan to use it for game engine and game development. But that's probably not the answer you were looking for.

I have experience with many programming languages like PHP, Python, Golang, JS, C, Scheme, etc. Each of these languages has its shortcomings that bother me. Taking C as an example, it lacks package management and doesn't support generics. In contrast, Nature is designed to improve upon C by featuring generics, package management, and null safety, among other things.

Moreover, what drives me is simply the joy of the process.


I’m curious, did you try Swift? It’s has most (but not all) of your goals AFAICT.


It might be interesting to write up comparisons of Nature to each of the dominant languages.

My impression is you want to make something as welcoming as Python but more expressive and safer. Which, if true, is indeed a worthy effort.


Not every language needs a marketing department. This looks like a fun project.


From another perspective, I think designing and building your own programming language is an incredible way to gain depth of knowledge and not simply breadth.


I agree. Tell me what motivated the language. What does it do that other languages in the same space don't do well?


That's true, but not every language has to cater to the whims of industry. Sometimes it can just be for fun.


Totally agree. I wish that new languages would state the 3 things that are unique about them


if ++languages>1500 { error "too many languages" }


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, <> 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. 'try expr', returning (val,err) is curious and I think I like it better already than try {} catch {}.


> 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.

Indeed:

    var array = [
      5
      - 3
    ]
Does that produce [5, -3] or [2]?


I've sometimes wondered why not make `-` whitespace dependent to resolve this one. Signed numbers store the sign bit in their representation, so enforcing the sign character to be in the same word also seems reasonable - and is there anyone who would mind actually having to put at least one space around binary arithmetic operators? We've all agreed that that's the sane way to write them by now, yes?


I'm one of those who would complain. I often write n+1 and n-1 without spaces. And I hate C for preventing space removal from expressions like:

  *z = *x / *y;
  addr = mask & &x;
  x + ++y;


Or ["5", "-", "2"] even


> If I were to add something its to use whitespace for array element separators. Eliminates the whole trailing comma issue...

I like how Nim solves this problem: just allow trailing comma on last element. It makes easier to copy paste elements, move them around and even sort (e.g. in vim).

```

var list = @[

  a,

  b,

  c,
]

```


Using the C for loop syntax is looney tunes, though. Do range support and leave that 70's stuff in the dust.


its got 'for k in list {}' (https://nature-lang.org/docs/the-basics/control-flow#iterati...) though array.for_each(lambda) is a better way to go, imho.


The Nix language uses whitespace in lists and I'm not the biggest fan—it works well when list elements are simple expressions (individual identifiers, numbers... etc) but gets awkward and confusing if you want to have more complex expressions. It's worse in Nix because Nix also uses whitespace for function application, so even function calls require extra parentheses, but I'm not a fan of it in any non-Lisp syntax I've used.


I'd like: drop 'try' and always allow and error to be returned, and ignored or checked at the users discretion. Optionally add "@error" or such, and let the tooling add or remove the annotation.

An FFI like luajit is asking alot, but inspired by it would be nice.


The one liner test cases drew my attention as well, it's pretty neat. Does any other language provide this sort of thing? I guess it wouldn't be hard to implement decorators for this in python


I like the feel of the syntax on first glance.

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/C++ and Lisp but kids these days are growing up with Python, Typescript, Rust, Go, Haskel, Kotlin, Dart, Swift, C#.

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.

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.


I do dream of some serious Erlang alternative that runs on its own without needing an entire runtime, but in all honesty Elixir / Erlang are insanely optimized, it blows my mind. I think I'm too used to the C#'s and Pythons of today, I too used Basic and a little bit of Pascal back in the day. I'm always excited by D but it gets overshadowed by Go and Rust it feels like, despite having really good features and a familiar syntax for anyone coming from C# / Java / C-like languages in my opinion.


I'm glad you mentioned D and I literally paused while writing the above to consider if I should include it. Back when I was writing a lot of C++ (decades ago now) my greatest hope was that D would catch on. It is hard to say why it didn't and I think all of the hype on the C++ successor goes to Rust these days. Zig is probably the most likely candidate for a C replacement even though D has a subset termed as Better C.

It really is the case that there is an endless list of programming languages now that serve as inspiration for almost every use case. I mean, I didn't even mention Clojure or Julia or Lua ... the list of truly interesting language and approaches is almost endless.


I see the potential in D, what I think it needs is a batteries included web framework maybe built on top of Vibe.d or forked from Vibe.d that means you don't have to piece together all the missing pieces. The more you can get done OOTB in a language, the more likely you are to use a language / framework.


I don't think you can have a serious Erlang alternative without an entire runtime, but if you are interested in the (better) C-style syntax, then you miht be interested in Gleam[1] which is a seriously cool Erlang based language that is built with standard styling and ideas (type-safe, concurrency (actor-based), C-style, immutable, you can even compile out to javascript and run in the browser)

Think Elixir, access to the entire Erlang VM (and any other language/package built on it) with the syntax of C and you are there.

[1] https://gleam.run/


I forgot about Gleam, it is definitely really interesting, but its also strange since I think you have to compile your code, I don't think you can just debug it as you write it.


I like the feel of the syntax, short, concise, clear, powerful and understandable even on first read. Combining the best of all worlds together.

Is that enough to give up the ecosystem from any other more established language? Most likely no.

For this to take off, it needs seamless interop with some other more established language or it needs to have some other major unique selling point. Rust had borrow checker. Go had goroutines. Both backed by big companies btw. Just 10% better syntax or 10% faster speed, without an ecosystem behind, is not going to be enough to tip anyone over, except the curious hobbyist explorers.

Hopefully some ideas from here will spread to other mainstream languages.


I use classes as syntactic sugar to a pure functions. People like their objects, but if you treat them as immutable struct data everyone is happy.. well at least less unhappy.


If you care about visibility control and minimalistic API design, then the most basic OOP features also provide a set of simple but powerful features: encapsulation, and contextual info on overload resolution (A.foo() is the foo() from A's type, no just any foo that can take A)


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's "best guess" as to what the user needed (in some cases they appeared to be designed for the sake of designing).”

Personally, I find nothing wrong with designing for the sake of designing.


One thing I miss about the Internet of just a few years ago is that such papers were freely available. Alas, now behind a paywall.

https://www.rand.org/pubs/research_memoranda/RM3447.html


It is, of course, still freely available if you plug the title into your favourite search engine.

From the US Defense Technical Information Center: https://apps.dtic.mil/sti/tr/pdf/AD0296046.pdf

Also in the Internet Archive: https://archive.org/details/DTIC_AD0296046

The mentioned quote is on page 22.


Your search-fu is better than mine.


A pleasant little language, it looks like weiwenhao started working on it back in 2021. It looks great!

I couldn'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.

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:

https://github.com/topics/programming-language?o=desc&s=upda...


I have a joy of programming in bash. Another language might be fun but the real joy lies in expressing oneself, solving a problem, getting the bon mot - 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


I started programming I'm bash a few months ago, and also found it enjoyable. But the part I found enjoyable wasn't just programming in bash. The part I loved was making scripts to automate all kinds of stuff and make my life easier—automate updating my yum repo, automate building my Docker images, make some install scripts for whatever I need when I distrohop, and little scripts to backing up and restoring my dotfiles.

If another language/shell, like zsh or fish was the preinstalled default, I'd program in that instead, but because of its basically-universal install base, I program in bash.


Oh, yeah. Bash rules. (Perhaps because I don't know zsh or fish, but hey! it rules for me.)


I guess I meant joy, even in something like bash... the joy lies in coding not in the language


Allow me a shallow opinion since we are in "joy of programming" territory: after python anything with curly brackets feels "uh". Give me python with typescript typing


After any good functional language like F# or Scala (also CommonLisp but it's less straightforward to start doing meaningful practical things in), anything else feels uh. My first experience with Scala was a shock about how concise and how bug-free programming can actually be. You just write what you mean and as soon as it builds successfully, it works and does what you expected it to do. Scala is easier to start with for those accustomed to the curly braces style languages and allow limitless expression. F# looks and feels more cool (although less familiar/intuitive for the majority, necessarily requiring some introduction) anyway and doesn't incentivize wizardy. To me F# essentially feels like "better Python" while Scala obviously is "better Java".

Any good interactive visualization or gpio library also opens another dimension of joy. QuickBASIC with LPT (which did the GPIO's job back in the days) access and drawing functions was a lot of joy already.

I am going to give this Nature language a try anyway. It indeed doesn't look super special at the first glance so it probably has some meaningful coolness hidden deeper - this is intriguing.


Nim does basically this.


Nim looks beautiful and seems to have impressive platform support already. Good taste / 10.


I hear you. I like Elm, Haskell and Ruby for syntax, as a personal preference, and no curlies-for-scoping.

But then I think the language models/paradigms are more interesting about these languages.


Typescript and Python actually have very similar typing models already. Given you run it through mypy or pyright of course.

Anything in particular you were thinking about missing?


In the "Error Handle" example ...

  11 var t = test {
  ---------------------------------------------
Should the variable `t` be `foo` here?

  ---------------------------------------------
  12     list = [1, 2, 3, 4, 5]
  13 }
  14 
  15 var (l, err) = foo.list[8]


You were right


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.

It doesn't look like Nature has ADT's, is that true or just missing from the docs?


A bit of a nitpick on the language on the homepage:

The description of the Fibonacci example seems incorrect, but I might be misunderstanding something about the language.

> A fib evaluation function was defined using recursion.

> The result of the function call was assigned to a variable named "result" and format the output using fmt.printf

    import fmt 

    fn fib(int n):int {
        if n <= 1 {
            return n
        }
        return fib(n - 1) + fib(n - 2)
    }

    fmt.printf('fib result is %d', fib(30))
No variable named "result" is ever defined, right? Maybe the description is outdated from a time when an intermediate variable was present.


Thank you for pointing out the bug in the website description; I have now updated it.


You are absolutely correct, while reading through it I was becoming increasingly concerned that whomever wrote the description was the language writer themselves. I expect a level of attention to detail from someone who is writing their own language.


Thank you for the heads-up! I'll be more careful with the details in the future. I am sorry about that, because all the current English documentation has been translated by GPT-4. It seems I wasn't fully prepared, but I'm still thrilled that someone shared the Nature project on Hacker News.


This will also never do anything if you pass it 0.


Look at the if statement again.


It'll return 0.


Depends on what brings you joy.

Update: Ok, non-glib serious comment: the "joy" of programming is highly subjective and the author might want to consider a different byline to avoid confusion. A "creative" or "hobby" programming lanugage for "experimentation," might make the point better.

Personally I don't find much joy in C-like languages as they're all approximately the same to me... and the "joy of programming," is less about syntax than semantics and form.


I believe the pleasure you derive from a language largely depends on what you use it for. What a language can truly offer is increased convenience and efficiency.


How exactly does it make someone experience the joy of programming?


As mentioned in the design philosophy of the repository, the goals are to be intuitive, more convenient, and to have a lower learning curve, among other things. Programmers are always the first-class citizens.


Because of the closeness to Nature?


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?


The primary channel for communication right now is https://github.com/nature-lang/nature , where you can engage and keep up-to-date through issues, discussions, and watching the repository.

Additionally, this is my first time hearing about the Mastodon platform, it looks really cool.


I find this promising. There are some weak points to highlight (not to criticize, but to help development).

What I don't like is that there are more ways to declare what a name means. Variables:

  var x = ...
  int x = ...
And even functions:

  fn f()...
  var f = fn()...
It makes reading someone else'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.

Besides, looking for the first time at a piece of code it'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:

  var box = rectangle {...
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 'var' mandatory:

  var x : u8 = 27
  var y : = 'hello'
  var f : fn(int)->int = {
With : repurposed, it can't be used for the return type; I used -> as in other languages.

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 'type' and 'as' (unless the syntax of the latter elements is changed to 'type:' and 'as:').

And talking about 'as', its priority must be clarified:

  z = a * -b as int
Does 'as int' apply to b, to -b, to the whole product, or to z?

I like how easy it is to declare union or sum types with '|', but the need to use 'as' and 'let' after an 'if ... is' makes it clumsy. Lazy programmers, the ones that wouldn't check for NULL in C, will simply add a 'let' here and there and perpetrate Tony hoare's billion-dollar mistake.

Finally, I'd like to understand exactly how the parser handles new lines. It looks like they end a statement, but are ignored in other contexts.


In-house non-llvm compiler? Ooh! This looks fun!

Will definately give this a peruse.


When I aim to create a piece of software, I not only want the users to be happy but also the people who build the software to find joy in the process. Using LLVM is a good choice, but creating your own compiler backend is definitely more interesting.


Man i don't know ... if things are not strictly immutable (or at least by default) i'm not so sure about the joy part.


Looks like the love child of Python and Go.

I like the syntax.


weiwenhao: The example in https://nature-lang.org/docs/the-basics/function#multiple-re... has `balance` and `product` swapped.


Thank you for the reminder. It appears I wasn't as prepared as I should have been. I will pay closer attention to details in the next version release.


I really like the syntax around error handling. It is similar to the usual try/catch, but looks a lot cleaner (at least to me, coming from Go).

Was this inspired by another language? I don't recall seeing a language with the same (or very similar) syntax.


oh yeah, 'try' as a hoist that can be programmed against would be so much nicer than forced blocks for try/catch. I like it a lot


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)


Just quick take from the code examples.

How is this more joyful than Rust Or Java or anything?

What is the key difference here that is about adding 'joy'?

Just not picking up on the sales case.


Why does everything need to be about 'sales'?

There is an emphasis on 'joy', it can be just about having fun.


If you want substitute in 'joy' for 'sales'. Its a figure of speech. What is the joys pitch of this language? It looks like a beginner friendly version of Java.

Im all for the idea of optimising for developers fun and joy but im not picking up the sales pitch either


It doesn't appear to have been submitted by the language writer and the website itself doesn't say it exists to bring you joy. It says "may you experience the joy of programming." Whoever wrote that is seemingly trying to be nice and say something similar to when a person on the street wishes you a good day. They're not trying to say you should be having a good day because their very existence is good for you.

This is a hobby language that someone made in his spare time and he gave it a website to share it. I don't see a sales pitch at all. It's more like someone sharing pictures of a hand-carved pieced of furniture they made themselves. The point isn't to say everyone else should be using it and it's better than other furniture. It's just hey, I made this, take a look if you're interested.


OK. That puts some context.

It isn't like there is some fancy new interface or paradigm to the language.

It is using "Joy" as in "Joy to all", "be joyful", "Have a nice Day".

Think the title of the post was maybe misleading that way.


Ok. So Not "Sales".

Then the 'Reason', the 'point'.

It is branded as "joy", this language does something different to make it 'Joyful".

At first glance it looks like any other common language.

So all I'm asking is - what is different. What is the change that someone can point at and say 'this solves some problem that makes it joyful'???


I think for many people, there’s an increasing feeling of dread that comes from using “modern” tools. There’s a heaviness to them that is difficult to put into words. And I think anyone who shares this sentiment feels joy when a tool feels light and airy and totally under their control.


Everything you do and want people to use requires a conversion about features and benefits. This is no different. While there may be no money exchanged here, you need to sell me on why this is any than any other language. Looks like the same overlogic mess as most of the others.


It doesn't need to sell you anything and it's not the intention of the author, they didn't even post the project on HN.


Yes. Think this was all miss-understanding. The author didn't submit. And, the title was misleading.


Nice to see another language with different approaches... I will check it as it is always interesting to challenge its knowledge


I like it. I'm going to give it a try.


Glad to see things like this. Think Phix is contender in the space. 100% RosettaCode coverage in 2021.


Sometimes I think we need more verbosity in programming languages. Imagine you're new to programming and come across this,

- what the hell is fmt? - what the hell is fn? - int? - n? - printf? what is f? - what is %d?

I know this probably isn't the crowd for this, but if my non-programmer friends curious about learning to code saw this they'd run for the hills. Sure this isn't a "learn to code" language, but a little verbosity is IMO not a bad thing: it is more humanist and can be self-documenting.


It's better for people to invest the brief time to learn what these things mean up front than have a language that's burdened with verbose keywords, forever.

Typing and reading "printFormatted" everywhere is going to get old really fast.


You can always have your cake and eat it too, if you allow either/or on all these reserved words - if you can define a function using either ‘defineFunction’ or ‘fn’


I think the kind of person who checks out programming languages in their free time probably does more coding on their own, so languages that appeal to them are the ones with concise syntax that's easy to type, even if some people find it cryptic. Rust and Haskell also may appeal to these programmers more than people with your opinion.


You may enjoy Austral: https://austral-lang.org/examples/fib Though I have no idea how that would go over with someone new to programming.


Any eta on a json module?


Reminds me of typescript, less parenthesis, and prefix typing.


The question I didn't find answered in their documentation: why?


The answer is in the title?


Is Unicode support on the todo list?


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.

Let’s keep reinventing the wheel!


If we didn’t reinvent the wheel we would all be riding on stone wheels.

Do people think we’re going to run out of space or something for these languages?

I’ll never understand how a persons personal triumph can be perceived negatively by another person.

Are you equally as upset when somebody paints a picture of a mountain, simply because other people have done that before?


consider the hypothesis that some things in this world might not be about you




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: