Nature: Programming language to experience the joy of programming(nature-lang.org) |
Nature: Programming language to experience the joy of programming(nature-lang.org) |
- 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.
Typing and reading "printFormatted" everywhere is going to get old really fast.
Let’s keep reinventing the wheel!
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?
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.
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.
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?
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.
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 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.
Personally, I find nothing wrong with designing for the sake of designing.
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.
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...
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.
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.
But then I think the language models/paradigms are more interesting about these languages.
Anything in particular you were thinking about missing?
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]It doesn't look like Nature has ADT's, is that true or just missing from the docs?
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.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.
Additionally, this is my first time hearing about the Mastodon platform, it looks really cool.
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.
Will definately give this a peruse.
I like the syntax.
Was this inspired by another language? I don't recall seeing a language with the same (or very similar) syntax.
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.
There is an emphasis on 'joy', it can be just about having fun.
Im all for the idea of optimising for developers fun and joy but im not picking up the sales pitch either
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'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.
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.
Indeed:
var array = [
5
- 3
]
Does that produce [5, -3] or [2]?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,
]```
An FFI like luajit is asking alot, but inspired by it would be nice.
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.
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.
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.
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.
*z = *x / *y;
addr = mask & &x;
x + ++y;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.
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.
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.
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.
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.
- 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.
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.
Additionally, my design philosophy is also included in the GitHub README.
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.