Hacker News new | past | comments | ask | show | jobs | submit login

The spirit is there definitely.

My take is that it's only a matter of time before emojis creep into every area where text is used.

Let's hope they won't ever become a mainstream part of programming languages.




I created a small library for Ruby/Rails that aliased a few methods with emojis. You could remove database objects by using the gun emoji, or trim a string with the scissors emoji.


This is pretty neat! Although, if I did it in my company, I would be packing my things very fast.


I guess yours are at least, in a way, semantic.

I've seen attempts where any connection between the symbol and what the method was doing was purely coincidental.


Check out Emojicode: https://www.emojicode.org/

"Emojicode is an open-source, full-blown programming language consisting of emojis."


Tell ya what, there's a Lisp dialect made with emojis.


> Let's hope they won't ever become a mainstream part of programming languages.

knowing a few people in this world, I am sure that this will certainly happen way before you can have variables named α, β, γ


You can already use Greek letter variable names in Python: https://stackoverflow.com/questions/17043894/what-unicode-sy...

I've used θ in code dealing with angles before.


That's a bad idea. How are other developers supposed to type this character (unless they are from Greece)?


keep it in the copy paste buffer, obviously /s.

For an even more extreme version, look at Perl6's atomic operators: https://docs.perl6.org/language/unicode_ascii#Atomic_operato... (or any other operators on this page for that matter).

IMO, it's not a "bad idea". Code is meant to be read, not written. If it renders the code more readable, then that's a win. But obviously, whether those symbols actually make the code more readable is debatable.


> whether those symbols actually make the code more readable is debatable.

In general, it would be rather silly to use greek letters for variable names. Yet sometimes, they tend to make numerical code much more readable when you are copying a mathematical formula verbatim.

Compare using "πθ" versus "M_PI*theta" several times on the same formula, for example.


I'm not from Greece and I can type any character I need to. It's just a matter of thinking very hard about it, and then the character "pops".


What do you mean? Remembering the compose key sequence?


yes, I want to use them in C. It is possible with clang but, unfortunately, not with gcc. I also want to be able to type them into TeX, both in math mode and in text mode, without much fuss.


\theta doesn't seem that bad. Typing something like \kissyface or \poop seems better than clicking around or typing a numeric code, albeit with the usual name guessing problem.

On OS X, and I assume others, you can add items to be automatically replaced, so something like "!t" could become a unicode theta if you want.


HN strips out emoji... but this works in ruby (replace "<emoji>" with a smiley for example)

    def <emoji>
      puts "helloworld"
    end
<emoji>

> helloworld


Swift lets you use any unicode characters, so emoji are perfectly valid variable names.

I've seen some "cute" github projects that use them, but they're obviously not for real life use since emojis are tough to type.


Purescript does the same thing (some people like using Unicode symbols for “forall” and function arrows) and it’s also led to amusing github goofs: https://github.com/i-am-tom/purescript-prelewd


In the book Diamond Age by Neal Stephenson the future working class are functionally illiterate so everything is communicated by emoji. Funny, but also a little bit frightening.


Eh, emoji is just pictographic script anyway.


Let's hope they won't ever become a mainstream part of programming languages.

If you consider Amp mainstream, or a programming language, it’s already too late.


Agreed... though, I'd imagine the mostly us-ascii centric programming model might be harder for some foreign languages. The worst, for me, as an example is when I see a special non-us character for JS examples as the assigned variable for a library.

edit: on the flip side, it's pretty cool for passphrases (where allowed)


The most-used emojis are designed as a language of emotions, making them ill-suited for most programming projects. But that doesn't mean that there aren't emojis that would be very useful in programming. Emojis just aren't used because we lack good input methods for them (outside of smartphones)


It’s too late. My company has a database where the name is the sunglasses emoji.


I remember a few years back a common hackathon project was to use lex and yacc to make emoji languages. It was always cool to see what people do with that. Maybe there will be an APL or something with emoji.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: