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

Reminds me of this comment from Reddit https://old.reddit.com/r/rust/comments/5penft/parallelizing_...

Go allows characters from the Canadian Aboriginal Syllabics for identifiers, so you can define structs or methods like this:

  type ImmutableTreeListᐸElementTᐳ struct { 
You can pretend that go has generics :)


You're forgetting the important bit:

> That's just a "template" file, which I use search and replace in order to generate the three monomorphized go files.

They were using a separate codegen step (really just a sed run) to actually "do generics". In fact, that was the entire reason this thing was introduced[0], the structure originally used interface{} for its items.

The "generic" part was then moved to a `go_` file from which monomorphisations on bool, ArrayT and ScalarT got generated.

Also

> Go allows characters from the Canadian Aboriginal Syllabics for identifiers

I'd expect just about any language which supports unicode identifiers to allow this, as canadian aboriginal syllabics is a "normal" abugida, and its "textual" components are (properly) tagged as XID_Start and XID_Continue.

[0] https://github.com/google/enjarify/commit/55e8e65e681b15f026...


Isn't that a syntax terror?


Names just need to be valid UTF-8, which it is


My misspelling was intentional... but now it's not funny




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

Search: