7 ms·
heh.. sounds like Go
by joshbaptiste 13y ago
heh.. sounds like Go
- randallsquared 13y agoIt's a lot more complicated than Go, but in return you get generics, templates, and AST macros.
- klibertp 13y agoLess opinionated. Supports generics. And meta-programming seems much more advanced. I'm particularly happy to see hygienic macros.
- idlewan 13y agoWith Nimrod's macro, you can do awesome things. It can improve readability a good deal. Here's an example I made: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/nawak/nawak_app.nim#L44 https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast... Go version: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/go/src/hello/hello.go#L92 https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast...
- skybrian 13y agoThe Nimrod version is shorter, but it seems harder to tell whether error-checking is done right.
- idlewan 13y agoNimrod has exceptions. I am catching them (https://github.com/idlewan/nawak/blob/specialpages/nawak_mongrel.nim#L58 https://github.com/idlewan/nawak/blob/specialpages/nawak_mon...) and returning a 500 error page with the detailed exception message. So you need less explicit error-checking everywhere with a language that support exceptions.
- pjmlp 13y agoGo is not that modern, for those of us that know the alternative world of Algol family of languages.
- TheCoelacanth 13y agoGo basically only has one modern feature (goroutines). Beyond that it's a throwback to Java version 1.
- skybrian 13y agoGo interfaces are also new.
- fedesilva 13y agoI hear people saying this all the time. Why? For me they are similar to type-classes+records but without polymorphism. Care to elaborate?
- klibertp 13y agoI looked at http://golangtutorials.blogspot.com/2011/06/interfaces-in-go.html http://golangtutorials.blogspot.com/2011/06/interfaces-in-go... and the only new aspect of Go interfaces I see is that they are implicit - they are considered implemented if the type implements functions that interface defines and you don't need to explicitly write "implements Something". This is a handy shortcut, but it doesn't look like a "serious feature". It also looks a bit like polymorphic variants in OCaml. Of course I might be missing something as I'm not that familiar with Go.
- wtetzner 13y ago> It also looks a bit like polymorphic variants in OCaml. Or like object types in OCaml. They also use structural typing.
- skybrian 13y agoActually it's a big improvement for large-scale programming due its effect on library dependencies. In Go you can easily declare an interface that matches a type in someone else's library without creating a hard dependency on that library. You can also superset and subset interfaces easily. That way you get loose coupling (almost like "duck-typing") in a mostly statically checked language. Contrast with Java where you'd have to both create a new interface and write an adapter class in a separate "glue" library that has hard dependencies on both libraries.
- fedesilva 13y agoNo. It has polymorphism and metaprogramming, things that Go (at least parametric polymorphism) eschews.