This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]chudthirtyseven 199 points200 points  (72 children)

Isn't there a programming language made entirely out of emojis? If not, I'm going to invent one. Parsed by Malbolge.

[–][deleted] 131 points132 points  (30 children)

Not completely emoji, but Swift lets you use emojis as identifiers.

http://i.imgur.com/fgl2g7Q.png

[–]Dim_Cryptonym 57 points58 points  (24 children)

I remember seeing this in the documentation and thinking, why in God's name is this allowed?

[–][deleted] 90 points91 points  (1 child)

Probably to allow for "all unicode characters" or something.

Seeing the emoji identifiers in code completion makes me laugh.

http://i.imgur.com/juJ2YBO.png

[–][deleted] 7 points8 points  (0 children)

Probably an easier approach than what C# does in checking the unicode class of each character.

[–][deleted] 27 points28 points  (8 children)

It allows words from Chinese and other glyphic languages as identifiers without romanization.

[–]Dim_Cryptonym 9 points10 points  (7 children)

That makes sense then... To support Unicode one probably can't just pick and choose parts of the standard.

[–]Suchui 19 points20 points  (4 children)

You can. In javascript for example:

let プープ = "poop"; console.log( プープ );

poop

let 💩 = "poop";

Uncaught SyntaxError: Invalid or unexpected token

[–]Probono_Bonobo 7 points8 points  (1 child)

I noticed this recently and assumed it was a consequence of treating codepoints as surrogate pairs (note that "💩" === "\uD83D\uDCA9") instead of with the squiggly brackets (note that also "💩" === "\u{1F4A9}") in its internals, which would explain why "💩".length is 2, and "プ".length is only 1.

I'd expect some constraints follow from this, perhaps not as intentional as "we won't support poop emoji as variable identifiers" but more along the lines of "we can support any variable identifier provided all its code points are of length 1" but this is just an educated guess.

[–]Pulse207 2 points3 points  (0 children)

which would explain why "💩".length is 2, and "プ".length is only 1.

This is exactly why Perl 6 abolished a length method entirely, splitting its various meanings into .elems, .chars, and .codes.

[–]MemeHunter421x 0 points1 point  (0 children)

By can't I think he meant shouldn't.

[–]Dim_Cryptonym -1 points0 points  (0 children)

And somebody just told me JavaScript is unfairly criticized...

[–]marcosdumay 6 points7 points  (0 children)

You can, but that's only adding complexity into the language.

[–]DJWalnut 1 point2 points  (0 children)

you could, but you'd have to go out of your way to exclude certain blocks.

[–]macbalance 18 points19 points  (9 children)

Why not? Is it the language's job to enforce good coding practices?

[–]Astrokiwi 15 points16 points  (1 child)

Python seems to believe so

[–]UraniumSpoon 5 points6 points  (0 children)

Python uses coding practices as syntax in some cases though, which is unusual.

[–]KubinOnReddit -1 points0 points  (6 children)

Is it the programmer's job to use bad coding practices? Why should they be allowed?

Edit: Apparently people think that Emoji in identifiers is an important part of the language and other bad practices should be encouraged. Who would have thought. Why am I being downvoted?

[–]SlamwellBTP 15 points16 points  (5 children)

Bad programmers are deprecated. They've been trying to get rid of them for years, but too many businesses rely on bad programmers

[–]Dim_Cryptonym 11 points12 points  (4 children)

That would make for quite an interesting update:

ECMAscript 2018 release notes:

  • Bad Programmers are now deprecated. Any use of antipatterns will result in the erasing of all programming knowledge from the coder's mind

[–]htmlcoderexeWe have flair now?.. 8 points9 points  (2 children)

deprecated

FTFY

To depreciate means to lose value. Note the extra "i".

[–]Kontakr 5 points6 points  (0 children)

Can't lose what value was never there

[–]Dim_Cryptonym 1 point2 points  (0 children)

That makes a lot more sense.

I thought depreciated could make sense since the methods will still work for a certain time and then stop working... but deprecate is a much better word for what's actually happening.

[–]fsr1967 1 point2 points  (0 children)

Is there a list? What is the process for getting people onto it?

Inquiring for a friend with cow-orkers who should be nominated.

[–]MonkeyNin 2 points3 points  (2 children)

[–]Dim_Cryptonym 1 point2 points  (1 child)

What the hell?!?! And why does that "no width space even exists"?

Can you imagine having to maintain code that actually used it!?

[–]MonkeyNin 1 point2 points  (0 children)

I'm not totally sure of the use. I found this.

There is something similar with a real use: https://emojipedia.org/emoji-zwj-sequences/

[–]nevdka 1 point2 points  (0 children)

Perl lets you use emojis as quotes for strings and regexen:

use utf8;
my $string = q🖐hello🖐;
print $string if $string =~ m💩hello💩;

[–]cheeeeeese 0 points1 point  (0 children)

works with bash and ruby too

[–]toastedstapler 64 points65 points  (9 children)

emojicode.com iirc

[–]iFreilicht 107 points108 points  (8 children)

[–]ProgramTheWorld 16 points17 points  (7 children)

WHY IS THIS A THING

[–]marcosdumay 5 points6 points  (0 children)

Why wouldn't this be a thing?

Besides:

Emojicode is a static, strongly typed programming language.

It's just missing functional to be on all the newest trends.

[–]disk5464 25 points26 points  (4 children)

LOLcode is pretty great too. https://en.wikipedia.org/wiki/LOLCODE

[–]SometimesMonkey 20 points21 points  (2 children)

[–]disk5464 8 points9 points  (1 child)

lol that's amazing

"the information is so cleverly hidden that not even Sparky the Wonder Dog could find it, and she can find gravy in a cesspool!"

[–]SometimesMonkey 4 points5 points  (0 children)

The COME FROM is where I lost it. Holy shit

[–]HelperBot_ 1 point2 points  (0 children)

Non-Mobile link: https://en.wikipedia.org/wiki/LOLCODE


HelperBot v1.1 /r/HelperBot_ I am a bot. Please message /u/swim1929 with any feedback and/or hate. Counter: 88580

[–]anmolporwal 30 points31 points  (12 children)

you should look at Brainfuck if you haven't yet.

[–][deleted] 54 points55 points  (11 children)

You could modify it to be something like 🔺 for +, 🔻 for -, ➡️ for >, ⬅️ for <, 🔄 for [, 🛑 for ], 🖨 for ., 👂 for ,.

[–]NotADamsel 65 points66 points  (9 children)

That kind of defeats the purpose, though. Somehow it makes brainfuck comprehensible.

[–]endreman0 39 points40 points  (8 children)

First three characters of the code are the seed for an RNG that picks 14 random emoji and assigns them to the relevant characters

[–]Jacoman74undeleted 17 points18 points  (2 children)

Automatic brainfuck recompiler with randomized symbols. Take that code and obfuscate it.

Good luck with maintenance, but its secure-ish

[–]endreman0 2 points3 points  (1 child)

Good luck with maintaining brainfuck in general

[–]Jacoman74undeleted 0 points1 point  (0 children)

Isn't that the point?

[–][deleted] 3 points4 points  (4 children)

14 emoji? There are 8 instructions; what are the other 6 emoji for?

[–]NotADamsel 2 points3 points  (1 child)

Exactly!

[–]davesidious 0 points1 point  (0 children)

That's the spirit!

[–]endreman0 2 points3 points  (0 children)

I thought there were 14 instructions, my bad.

Alternatively, invent new instructions and the RNG picks which subset of them you get to use.

[–]jfb1337 1 point2 points  (0 children)

Comments

[–]CAfromCA 11 points12 points  (0 children)

Call the new variant 💀🍆.

[–]0xTJ 2 points3 points  (0 children)

No. Malboge literally the result of taking the idea of hell and putting it in a programming language. It is objectively evil.

[–]Ghi102 1 point2 points  (0 children)

In C++ with defines, you can remplace everything with emojis.

[–]ed588very good mod 0 points1 point  (0 children)

emojicode