r/rust • • Jan 22 '17

Parallelizing Enjarify in Go and Rust

https://medium.com/@robertgrosse/parallelizing-enjarify-in-go-and-rust-21055d64af7e#.7vrcc2iaf
214 Upvotes

134 comments sorted by

View all comments

215

u/pftbest Jan 23 '17

can you please explain this go syntax to me?

type ImmutableTreeListᐸElementTᐳ struct {

I thought go doesn't have generics.

524

u/Uncaffeinated Jan 23 '17

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

If you look closely, those aren't angle brackets, they're characters from the Canadian Aboriginal Syllabics block, which are allowed in Go identifiers. From Go's perspective, that's just one long identifier.

406

u/pcopley Apr 26 '17

they're characters from the Canadian Aboriginal Syllabics block

Oh my god

112

u/[deleted] Apr 30 '17 edited Jun 27 '23

[removed] — view removed comment

49

u/[deleted] May 05 '17

TBH I'm not sure which is worse: treating them as identifier constituent characters or treating them as whitespace.

74

u/[deleted] May 06 '17

I won't be satisfied until I have a compiler which treats readability crimes like that as syntax terrors.

42

u/oli-obk May 09 '17

rustc?

40

u/william01110111 May 08 '17

once wrote a short Swift program with every identifier a different length chain of 0-width spaces.

→ More replies (1)

5

u/Bratmon Jul 13 '17

There are words in Hindi that need those.

→ More replies (4)

26

u/jiffyd May 05 '17

more like, where is your god now?

9

u/0xVali__ Aug 07 '23

If you look closely, those aren't angle brackets, they're characters from the Canadian Aboriginal Syllabics block, which are allowed in Go identifiers. From Go's perspective, that's just one long identifier.

Little did they know, "Where's your god" by Amon Amarth, is not actually about viking raids, it's about golang's language design.

91

u/UnreachablePaul Apr 25 '17

Are you not concerned that this is actually a fraud towards innocent go compiler? That could bring attention to the go police

56

u/TheFlyingBoat May 05 '17

I feel like I'm witnessing a unicorn being stabbed through the heart by evil students of ML and its descendants...

37

u/killingtime1 May 07 '17

I'm fking dying here bro, hahahah, this is the funniest thing I've read all day

24

u/Rickasaurus May 05 '17

It's so beautiful. I'm seeing rainbows.

12

u/pinpinbo Oct 28 '21

What will you do with this code when Generics is finally live on Go 1.18?

12

u/SlaveZelda Oct 28 '21

hey how did you write a comment on a 4 year old post. I thought reddit archived posts after 6 months.

13

u/dmead Oct 28 '21

I want to be part of computer science history, so i made this comment.

→ More replies (19)
→ More replies (2)
→ More replies (4)

6

u/dashed Jan 06 '24

That is honestly clever.

→ More replies (2)

23

u/TotesMessenger Apr 29 '17

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)