Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Forgive me while I make some gross generalizations:

  Objective-C -> Swift
  Python -> Nim
  Ruby -> Crystal
  JavaScript -> Elm—or maybe TypeScript?
  C/C++ -> Rust
The future looks good.


C++ -> Rust

...is correct, but

C -> Rust

...is not IMHO. There needs to be a much smaller, simpler, "better C" language than Rust to replace C. Something like zig, or C2, even C99 almost feels like a new language.

PS: ...and I forgot the fairly obvious C -> Go :)


I'm not convinced you can be much simpler than Rust while maintaining memory safety without GC (including reference counting) while still having standard heap allocation and deallocation. If you throw out memory safety, then sure, you can be simpler.


I'm looking forward to exploring this space in the next 1-2 release cycles of Zig. I have some ideas that will make debug and release-safe builds of zig code actually safe with regards to use-after-free and related memory issues.

The programmer will still be required to adhere to C-like manual memory semantics, with the difference being the language runtime catches safety mistakes. And then of course in bottlenecks the safety checks can be omitted.

If I accomplish my goal, the difference between safety/performance trade-off of Rust and Zig will be that Rust's release mode is both safe and fast, whereas Zig code has the simplicity but the programmer has to choose between performance and safety per scope.


I'm not familiar with the C-family languages, but given that Go is GC, wouldn't Rust be a better "C 2.0"?


I would still put Go into the "better C" language group because of its elegance and simplicity, even if it can't be used for all scenarios C can be used for (because of the GC).

To me at least, Rust looks like an obvious attempt to fix C++'s problems for large scale software development, but at the cost of being a big and complex language, similar in scope to C++. "Modern C" is a much simpler and elegant language, even though there's some decades old cruft, overall it remained a lot cleaner than C++ because there hasn't been so much stuff added in the first place which would be a burden now.


I sincerely can't fathom how Go can be considered a "better C". It's like comparing cars to sheet metal (or some better analogy).

Go is fundamentally incompatible in most contexts C would be your go-to. A moderately heavy runtime with both a scheduler and a GC unable to compile down to a ".so"? C++ and Rust can both do those things readily.

Languages aren't just syntax/semantics, they're ecosystems within ecosystems. They fill niches with particular their capabilities.

A more appropriate comparison is Go to Java. Distict approaches to "half batteries included" robust application and service development.


> A more appropriate comparison is Go to Java.

Not even. Golang lacks the expressiveness and vast standard library in Java (e.g. nothing even close to what java.util.concurrent has), not to mention the very diverse ecosystem, tunable high performance GCs, and management capabilities of the JVM.


But those are all great, directly relevant, appropriate points of comparison. And they work because those two language operate in a similar niche.


I'm not sure they are. golang was force fitted into writing applications it was not meant for. It was made to be a C++ replacement, but it ended up anything but (basically ended up as a Python and NodeJS replacement).

I can see golang being useful in smaller tools that have some networking capability (and with GraalVM+AOT, Java fills in that niche as well). However, with anything slightly more complex (including REST APIs), and it falls way short. So it shouldn't be compared to Java.


I gotta agree to disagree with you on this.

Python/NodeJS/Java/Ruby/Go all have a solid presence in the "I need to spin up a REST/SOA/gRPC/glue service wherever" niche. They each have a range of performance, expression, resource optimality, and ecosystem tradeoffs; but they're all still heavyweights in this particular domain. They each have a presence in other "types" of programming but I think it's also fair to compare them within this one.

Go has a few things which make it especially nice in this field out of the box. Goroutines + channels + select help solve the same class of problems that made reactor patterns, work stealing fork-join pools, listenable/completable futures so popular in Java-land. Go's sockets give you epolling for free where we'd use Netty in Java land.

In fact, they each if those language ecosystems struggle with that class of problem in this field: Good kernel thread utilization in the presence of very mixed cpu + network I/O load. What's why they all have a handful of the same approaches: Ruby/Python/NodeJS all do the reverse proxy on top n processes of of libuv/gevent/whatever event loops (reactor pattern). Java and Go are actually similar in that they actually try to use threads well within a single process.

I say this as an obsessive Java fanboy. I'm jealous of a few Go things I can't have: Goroutines (green threads) and flatter struct+array memory allocations. I can't wait for Loom and Valhalla.


> I can't wait for Loom and Valhalla.

You said it yourself. Once Java gets those, there isn't really much reason left to use golang. And with probably better performance as well (I know the techempower benchmarks have their issues, but if you noticed, golang's standard lib is towards the bottom of the list).


The creators of C/Unix are the creators of Go.


C/Unix is generally largely credited to Brian Kernighan, Dennis Ritchie, and Ken Thompson. Although Ken Thompson did contribute to Go, he appears to have retired early in the life of the project (I can't find any contributions of his that don't pre-date Go's 1.0 release in 2011), and credit for Go instead tends to lean toward Rob Pike and Robert Griesemer, the former of whom worked at Bell Labs, but appears to have joined in time to have more of an impact on Plan 9 than on Unix. In particular Go bears very striking resemblance to Pike's two earlier languages, Limbo and Newsqueak.


>In particular Go bears very striking resemblance to Pike's two earlier languages, Limbo and Newsqueak.

From the GoPL (The Go Programming Language book, by Donovan and Kernighan), page xii, part of the genealogy is:

CSP (Hoare, 1978) -> Squeak (Cardelli & Pike, 1985) -> Newsqueak (Pike, 1989) -> Alef (Winterbottom, 1992) -> Go (Griesemer, Pike and Thompson, 2009).


Not at all.


Did anyone have experiences with ATS lang [1] as C replacement?

[1] http://www.ats-lang.org/


There's always "D as better C".


Right. For anyone who wants to get a feel for D:

https://dlang.org/ is the main site.

https://tour.dlang.org/ is the D tour site, similar to the one for Go and some other languages nowadays; you can run some D example programs right from the site, without installing the language on your machine.

On my blog, I have a handful (12-13) of exploratory D programming posts, that may also be of interest. They explore various basic but interesting features of D via some simple D command-line programs:

https://jugad2.blogspot.com/search/label/DLang


Particularly D's stripped down "better C" mode.


C -> Zig


I like Zig, but it doesnt even have a HTTP client yet:

https://github.com/ziglang/zig/issues/2007

granted neither does C, but C has cURL, and Zig doesnt (and wont) have cURL binding:

https://github.com/ziglang/zig/issues/2056


This is a misrepresentation of the facts. Zig can use libcurl just as much as C can. Unlike other languages, zig does not need bindings to use C libraries. It's one of the main features.

The issue you linked is saying tht zig standard library will not introduce a dependency on libcurl.


Andy, you are a really smart and talented person

but surely you know the difference between FFI and binding?

They are not the same thing, and Zig doesnt (and wont, according to you) have cURL binding.


Python, Ruby -> Go. Nim and Crystal are pet project compare to other languages, no support, no community, no libraries, Crystal doesn't even supports Windows or threads. They are in pre alpha stage at best.


I found Nim to have a small but active and supportive community. The library ecosystem, while a little thin, has a lot of activity, and I was able to find what I needed or create wrappers for C libraries.

One difference between the Swift and Nim communities is that where Swift's is full of noobs answering each other's questions, Nim's is full of experts who are just as eager to help.

Nim also has pretty good, fairly complete docs and a decent book.


> no support, no community, no libraries

That's grossly incorrect about Nim. I'm a C/C++ noob and I've found a lot of C/C++/Nim/CS experts answering my questions and helping me out on Nim IRC/Gitter/Nim Forums.

Recent (as recent as few hours ago) proof: https://forum.nim-lang.org/t/4912


It's not like you can contact Google and get support for Go. The Nim community might be smaller but you still get help if you ask.


This precisely. Try getting help from the creator of Go, it's next to impossible unless you work at Google or are a core Google dev. The Nim author on the other hand is very active on IRC and the Nim forum.


hence why I said the word "future"


Right now Go ( among others ) is replacing a lot of Python / Ruby, there is no future for Nim / Crystal in that space anytime soon. Crystal will most likely die, same for Nim I don't have hope about language not backed/ created by large companies.

https://dev.to/nditada/comment/lnl


I'm a bit sick and tired of Google being everywhere and in everything so I'd rather invest my free time in learning a language created by highly motivated individuals than learn Go.

> I don't have hope about language not backed/ created by large companies.

This does not align very well with history. PHP started as Rasmus Lerdorf toy, That didn't prevent it to grow and support some of the biggest platforms on the web. Python was also a one-man band for a while before it gained traction.

The future in uncertain.


This world does not need more corporate-owned, corporate-driven "open" source.


PHP got traction after Zend was created ( private company ) and Python has the PSF. None of Crystal / Nim have such a structure.


I'm curious where your negativity is coming from, all of the comments you've written on this thread so far are negative.


Sorry I know I sound pretty negative, it's frustration about people pushing for languages that are clearly not ready and for some of them will never be.


You've got to realise that to a lot of people these languages are already ready. Nim coming closer to 1.0 is certainly evidence that it will soon be ready for a vast majority of users.


> None of Crystal / Nim have such a structure.

That's right. Not yet.


I have to agree on Crystal

issue for Windows support has been open for... 6 years

https://github.com/crystal-lang/crystal/issues/26


This is what it is for me:

  Objective-C -> Nim (can compile to ObjC, calls methods directly without overhead)
  Python -> Nim (Nim is a super fast python that prevents typos)
  Ruby -> Nim (Nim is better in every-way)
  JavaScript -> Nim (compiles to plain JS (if you need talk to legacy JS libs like most people) or WASM (if you just want speed))
  C/C++ -> Nim (Can compile to C++, calls methods directly without overhead)
Basically...


Yeah, Nim has impressive coverage of targets. I dislike almost everything about Nim: the syntax, complexity, weird case insensitivity, documentation, community, package manager...Yet this trait alone makes Nim worth leaning for me.


Hmmm , cannot agree with you here: syntax is great and easy to learn, complexity crockable in a day or two, documentation looks good and actively being worked on , community is very welcoming and knowledgeable, package manager nimble is easy to use. Have you actually tried yet ?


There's a huge effort on the documentation part recently, and the community is kind. Any specific pain points?


Don't forget that Nim can compile down to JavaScript as well :) So you can actually use Nim to create your JS frontend and your C-compiled back-end.


Java -> Kotlin (or even modern Java)

JavaScript -> Typescript

C# -> F# (or even modern C#)


I would stick with the modern variants from Java, JavaScript and C# until the underlying platforms get rewritten in the guest languages.


why?


Guest languages introduce additional layers to debug, usually lack in tooling vs platform languages, require additional FFI considerations, their communities tend to create their own libraries and build tools to parallel platform libraries and tools, just to be more idiomatic.

Also they aren't guaranteed to be around forever.

Platform languages stay around while the platform is still relevant.

So, Kotlin is Android's Swift. Outside Android I bet that in 5 years it will be as relevant as Scala and clojure are today.

TypeScript is a wonderful language from Anders, but tsconfig.json allows to change the semantics in multiple ways and it is relatively hard to track down what changed in every release.

F# is only partially supported across all .NET deployment scenarios and VS Tooling. It was even left out of the new WinUI roadmap announced at BUILD 2019, even though .NET Core does support it.


Java -> Go?

Not so much in the language design inspired by sense, but I see a lot of Go being used in places that were previously Java.

K8s was originally written in Java.

Personally very happy to operate fewer Java services...


I've seen more Ruby -> Go and Python -> Go myself. I think Go is just pretty well suited to breaking up large monoliths into microservices which is common across the industry.


Yeah, good point. We're doing a fair amount of JavaScript (Node) -> Go.


That is a step backwards.

Java 12 -> Go aka Java 1.4


Don't forget Julia for Python and data science!

(Obviously also a huge generalization :))


and obviously

    haskell -> haskell


And AFAIK: Clojure -> Clojure


(-> clojure clojure)


Not (-> lisp clojure)?


threading lisp through clojure is probably just going to get messy tbh.


we need an ourobouros glyph


λf. (λx. f (x x)) (λx. f (x x))


that's a long glyph, but I'll take


I don't know if I'd compare Nim to Python precisely; aside from the significant whitespace, I'd say Nim's syntax is directly descended from Pascal, and Nim's philosophy appears to hew more towards TIMTOWTDI than TSBOAPOOOWTDI (although I suppose we could debate whether modern Python still adheres all that closely to the latter). As a result it might appeal more to Rubyists.


From the nim homepage:

> It combines successful concepts from mature languages like Python, Ada and Modula.


Sure (and note that Modula is itself a Pascal descendant, from none other than the creator of Pascal), and although it seems true to say that Nim's significant whitespace was inspired by Python, I don't think there's much else that will be familiar to Python users. Other than "indentation-based syntax", the featured bullet points on the homepage don't describe Python features, and having used Nim lightly (a while ago, mind) my impression of it was very unlike Python. However, it's possible that I'm among a minority of people who think that significant whitespace is very nearly the least important feature of Python.


I've used Nim a bit and even read most of Dom's book (Nim in Action) and it felt pretty natural to me as someone who does most of their coding in Python. Sure it has some Modula inspired keywords, but it still feels Pythonic in a way I can't easily describe.

Rust on the other hand hurts my brain like Haskell as it is so foreign.


It isn't exactly accurate. Rust is more like c++ and Nim is more like python+c+pascal. But yeah "The future looks good."




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

Search: