Could I ask about your thoughts regarding Go (which has much less syntax and fewer features than all of the above). Have you looked into it?
Could I ask about your thoughts regarding Go (which has much less syntax and fewer features than all of the above). Have you looked into it?
In fact, I think Go doesn't quite deserve the reputation it has as being a simple language. It's a familiar language, and it's a bare-bones language, but that's not the same thing as being simple.
One last thing that was interesting: I got more null pointer runtime exceptions in Go than I expected (vs none in Nim, for example). Granted, I'm a Go n00b, but I'm also a Nim and Dart n00b, and didn't have nearly as much trouble with those two languages (aside from the aforementioned compiler bugs).
I really wish modern statically typed languages would rid us of null pointer errors once and for all. This is totally possible with Option types, but seems to rarely be done. I wonder why?
However, the compiler could (and did, I believe) run inference and suggest a fix that the programmer can explicitly include.
There are a number of RFCs in the pipeline to help with lifetimes, including more elision. In no particular order:
https://github.com/rust-lang/rfcs/pull/2115
Granted Rust has some paradigms and constructs which are not easy to learn, I found it rather exciting. I think it has future scope.
Wonder whats happening with Redox. I hope Rust adds more libraries, especially network related, since the networked world is increasingly looking like a distributed OS of sort. Browsers are looking like an OS or a shell inside the OS. Browsers are getting more complex with more functionalities added every few months. Not sure I expressed my thoughts correctly, but I guess one can understand what I mean.
Rust should move away from C standard library, if possible.
They've been involved in Google Summer of Code, and so have had lots of status update posts lately, here's the latest: https://redox-os.org/news/gsoc-self-hosting-final/
> Rust should move away from C standard library, if possible.
It's not always possible, but on systems where it is, there's some ability to do so, see https://github.com/japaric/steed
>It's not always possible, but on systems where it is, there's some ability to do so, see https://github.com/japaric/steed
Doesn't linking to it make a Rust program "unsafe", in the Rust sense? Or my understanding is probably not correct.
Toy example, a language that is simpler than possible:
- If a language does not have functions, you must copy and paste the code every time you call it. Such a language would be "simpler than possible".
The only example I know from Go:
- Many people feel that the lack of generic functions can be solved similarly - such as copying and pasting code or doing search/replace - but makes the language "simpler than possible". (in the exact sense you mean.)
(A generic function is one that works on different types without knowing what they are when it is written, or similar behavior.)
So I've given you a single real example. But it's the only one I can think of.
Other than this example, can you list the ways in which you feel it's "simpler than possible" or went "too far"? I would really appreciate if you could be specific.
It seems like strings are basically the only data type of unlimited size that is supported as map keys (or at least that seemed to be the case a few years ago).
I think that only types for which equality is defined in the language could be used as keys. Those types where numbers, characters and all other "small" fixed-size types, structs all of those members had equality defined, arrays of a type with equality, and strings. The size of an array is part of the type, so in that list of types with equality the only source of unlimited sizedness are strings.
I guess that cover most cases where you want a type of unknown size as a key, but I found it pretty annoying. If you want to use, say, polynomials with integer coefficients as keys in a map, you'd have to either choose a fixed maximum size (degree, for example, or number of monomials) for the polynomials or convert back and forth between strings.
It's not the only language that forces you to convert things to strings and back for use as map keys (AWK and Lua come to mind), but I wish it didn't have that limitation.
---
Thanks for your answers!
So I know you don't want to rehash what's easy to find elsewhere, but your perspective is different because you wrote a Clojure interpreter. It's not the same as what I can find from people who just use languages.
You just list:
>(e.g. no generics, error handling littering my code and obscuring intent, etc).
But could you flesh out this litany of complaints, even if it's common? I just want to know your version of that list, without the 'etc'. It's not going to be the same as other people's - different things will bother you or come to mind for you. I'm trying to understand these from your perspective and background. (which is unusual.)
Secondly, you write "but that's not the same thing as being simple". I don't really understand. Here on HN, people say you can pick up Go in an "afternoon" and become proficient in "a week".
You write that it is not simple but I don't know what you mean in specific, even when you write as a "Go n00b". This reply will be particularly interesting to me, because, since you've literally written an interpreter, compared to an average user, everything is simple for you.
Like, think of a standard designer who has first dabbled in Javascript and for some reason picks up Go. Whatever isn't "simple" for them would ordinarily be super-simple for you. So what's not "simple" for you is like obscure string physics to a person who is barely a programmer at all. I'm really curious what parts you didn't find simple.
Thank you.
No generics, error-handling obscuring flow of logic, dependency-management, the compiler complains about not-used vars and imports (which is great, except when you're prototyping) it should be togglable, it felt like I was producing a lot of code to do something small (I felt the same about C, but not about e.g. Nim), and then, I think the little oddities I mentioned in my comments on simplicity added up to make me feel like I was building an inelegant solution.
That's off the top of my head. There were possibly other gripes, and I am possibly mis-remembering, so take it all with a grain of salt.
(What I mean is if if you worked with Go every day you likely would not have the same perspective anymore.)
so thank you, perfect reply.
Simplicity is not the same as familiarity. It's not the same as a small feature-set, either. Gratuitous Rich Hickey reference for what I mean by simple[1]. So most languages aren't simple by that definition, but I'd say that Go's inconsistencies prevent it from being what I call simple. Some examples:
Instead of having a general mechanism for describing datatypes, they have several one-off, exceptional syntaxes (such as for how you define tyep type of a map).
Go's dependency management / vendoring (or lack thereof) is complexity-inducing, even though it appears simple at the outset.
Sometimes you do things via method (such as `fmt.Println(message)` and sometimes via function (such as `len(message)`).
And so on. Coming from a language like Clojure that is regular, possibly to a fault, Go seemed to be littered with one-offs and inconsistencies.
[1] https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
I will, however, point out that you're likely using a different definition of simple ("easily understood or done; presenting no difficulty. ") than is often used in technical circles ("composed of a single element; not compound"). Simplicity and ease are distinct, and one does not necessarily imply the other; it's not hard to find convoluted designs that feel easy due to familiarity, while a much smaller, consistent design will feel difficult because the concepts (while fewer in number) are foreign.
Rich Hickey (creator of Clojure) gave a great talk on easy vs simple: https://www.youtube.com/watch?v=rI8tNMsozo0
Here's something familiar to most professional web developers: JavaScript.
But it's also complicated: https://www.destroyallsoftware.com/talks/wat
Here's the spec: https://www.ecma-international.org/ecma-262/8.0/index.html
And here's something unfamiliar and often considered difficult: lambda calculus.
And yet it's very simple. Here's the entire definition of lambda expressions (lifted from Wikipedia):
---
Lambda expressions are composed of:
* variables v1, v2, ..., vn, ...
* the abstraction symbols lambda 'λ' and dot '.'
* parentheses ( )
The set of lambda expressions, Λ, can be defined inductively:
1. If x is a variable, then x ∈ Λ
2. If x is a variable and M ∈ Λ, then (λx.M) ∈ Λ
3. If M, N ∈ Λ, then (M N) ∈ Λ
Instances of rule 2 are known as abstractions and instances of rule 3 are known as applications.
---
So, while JavaScript programmers might find the lambda calculus unapproachable, it would be difficult to argue that the former has fewer gotchas than the latter, as the former is wildly complicated and the latter is so simple that you could fit its definition on business card. Once you appreciate the difference between simplicity and ease you can better evaluate your options, as it might be worth investing time in learning an intimidating, foreign solution if you believe that it will provide better stability/correctness guarantees/etc. Also, simple things are generally easier to work with compared to complex things assuming a similar degree of experience -- so investing in unfamiliar-yet-simple things will often save you a lot of effort in the long run. Strictly adhering to familiar things is a recipe for being stuck in a local optimum.
To take this full circle, Go being easy doesn't mean that it's simple.
You weren't kidding about the lambda calculus definition!
https://en.wikipedia.org/wiki/Lambda_calculus#Formal_definit...
With that said, your comment seems quite technical, about the single point of simplicity. You don't talk much about Go at all, and although the other poster has also answered, I'd be curious in your answer as well (if you've worked with Go):
You've given a definition of simplicity (correcting mine). Did you find Go simple? What other thoughts did you have?