News for hackers. Stuff that matters.
Re:Neugram – Scripting in Go by ainar-g on Saturday November 04, 2017 @03:22AM (#15624130)
Can you elaborate on what syntactic conveniences are difficult to implement and why? Language design is on of my hobbies, so I really would like to know that.
Re:Neugram – Scripting in Go by crawshaw on Saturday November 04, 2017 @07:44AM (#15624609)
One good example is untyped constants. They form a large extension to the type system only present at compile time. It is a good example because there is an excellent blog post describing them in detail: https://blog.golang.org/constants

In particular note the difference between

    const hello = "Hello, 世界"
and

    const typedHello string = "Hello, 世界"
one of these can be assigned to named string types, the other cannot.

As a user of Go I find untyped constants to be extremely useful. They almost always do what I want without surprise. Implementing them however, is not trivial.

A tricker example is embedding. It adds a lot of complexity to the type system. As a user, it can be a bit surprising, but I admit it is very useful.

Re:Neugram – Scripting in Go by mjburgess on Saturday November 04, 2017 @07:13AM (#15624553)
At a guess, I would describe it as a trade off between syntax and semantics.

Languages that have simpler syntax tend to have far more complex semantics (to infer what's missing, etc.).

Eg. python's semantics is horribly complex: "hello".upper() is something like str.__dict__['upper']("hello")) -- which is all run-time. Whereas say a C++ version amounts to quite a simple run-time function call on some bytes.