News for hackers. Stuff that matters.
Re:Tabloid: The Clickbait Headline Programming Language by thesephist on Thursday September 24, 2020 @10:23AM (#24578868)
Hey HN! Author here, feel free to AMA. I've made less joke-y languages too before, most prominently Ink [0] which I use to write some of my own apps for personal notes/contacts/etc.

[0] https://dotink.co/

Re:Tabloid: The Clickbait Headline Programming Language by braythwayt on Thursday September 24, 2020 @11:26AM (#24579495)
"Tabloid is a real, turing complete programming language written in JavaScript, inspired by _cilckbait_ headlines."

I like the deliberate misspelling of "clickbait," it layers a spam email feel on top of the clickbait ethos. Bravo!

Re:Tabloid: The Clickbait Headline Programming Language by vestrigi on Thursday September 24, 2020 @11:00AM (#24579242)
Lovely creation you made! I started to wonder if some kind of template could be made from this that just requires you to enter your individual keyword names for the basic operations, regarding that it is just interpreted by javascript. I'm not at all into esoteric languages so I don't know if something like this exists. This approach just seems so simple to me, especially in case you want to create some more languages just for fun or want to open the doors to more beginners. The only boring thing would be that essentially each language created with the template would work the same way unless you modify that template.
Re:Tabloid: The Clickbait Headline Programming Language by penne12 on Thursday September 24, 2020 @11:02AM (#24579259)
This is actually a pretty neat idea. Should be pretty easy by just swapping out the tokenization loop logic. https://github.com/thesephist/tabloid/blob/e0d16ea54eced809e...
Re:Tabloid: The Clickbait Headline Programming Language by dmcbrayer on Thursday September 24, 2020 @10:45AM (#24579074)
This seems like a pretty large effort to commit to a joke. I applaud the effort, but I'm curious. What's your motivation?
Re:Tabloid: The Clickbait Headline Programming Language by thesephist on Thursday September 24, 2020 @10:48AM (#24579113)
I've implemented a few small toy languages before and Tabloid was intentionally sort of sketched out to be similar (expression-based grammars, whitespace-insensitive, recursive, etc.) so it was just mostly a matter of reimplementing those things with slight variations (the biggest being that entire phrases could be keywords). Doing so in JS made prototyping pretty fast.

I guess besides the fun of just the comedy of the idea I wanted to get back into JS (I haven't written JS in a while) and wanted a project I could fit into one night, so I sort of swizzled the language design so it wasn't super complex and doable in a few hours.

Re:Tabloid: The Clickbait Headline Programming Language by IncRnd on Thursday September 24, 2020 @11:32AM (#24579566)
Believe me, I've used absolutely EVERY LANGUAGE THERE IS. Imagine 4th Gen, dbs, procedural, OOP, blah blah blah. What REALLY MATTERS in the _Real World_ is TABLOID!

But WAIT, THERE's MORE! Before you delete all the other code and languages, first throw your computers and tablets away. TABLOID doesn't need any of that! TABLOID is Turing-Super-Complete!

Re:Tabloid: The Clickbait Headline Programming Language by _the_inflator on Thursday September 24, 2020 @10:43AM (#24579055)
Hilarious!

Nicely done.

Re:Tabloid: The Clickbait Headline Programming Language by mijoharas on Thursday September 24, 2020 @11:21AM (#24579438)
nice stuff.

fyi, You've doubled up the line `BEATS / SMALLER THAN` under "how much is there".

Re:Tabloid: The Clickbait Headline Programming Language by thesephist on Thursday September 24, 2020 @11:22AM (#24579447)
Nice catch! Thanks. I'll toss that in my todos :)
Re:Tabloid: The Clickbait Headline Programming Language by linux2647 on Thursday September 24, 2020 @11:02AM (#24579255)
> But why?

> Didn't want to do homework for my database systems class, and needed something to do to procrastinate.

Amazing answer. But actually, I’ve found this to be true in my own life. Sometimes I work on a problem for too long and a creative break allows for improved creativity to flow when I go back to the original problem.

Re:Tabloid: The Clickbait Headline Programming Language by fredleblanc on Thursday September 24, 2020 @11:31AM (#24579551)
Since we're pitching ideas, I'll pitch comments be any line that starts with "OFF THE RECORD..."
Re:Tabloid: The Clickbait Headline Programming Language by phrz on Thursday September 24, 2020 @10:57AM (#24579215)
I suggest "10 EASY STEPS FOR BETTER i" as for(i=0;i<10;i++).
Re:Tabloid: The Clickbait Headline Programming Language by penne12 on Thursday September 24, 2020 @11:01AM (#24579249)
10 [EASY|QUICK|WEIRD] STEPS = Range

[list expr] FOR [variable name] = map operator

Re:Tabloid: The Clickbait Headline Programming Language by rcfox on Thursday September 24, 2020 @11:29AM (#24579528)
Would be nice to fit "NUMBER X WILL SURPRISE YOU" in there as a way to break out of the loop (`if (i == x) { break; }`), but I think that would require tracking the loop variable as context, which kinda sucks.
Re:Tabloid: The Clickbait Headline Programming Language by guram11 on Thursday September 24, 2020 @11:41AM (#24579676)
or maybe "TOP 10 SECRETS 0 PERSON KNEW ABOUT"

This is a funny and shitty idea for a programming language while at the same time retaining something inspiring about it OTOH, really worth my time

Re:Tabloid: The Clickbait Headline Programming Language by Joker_vD on Thursday September 24, 2020 @12:31PM (#24580388)
But does it support fake news?

    WHAT IF TOTALLY RIGHT IS ACTUALLY COMPLETELY WRONG
        RUMOR HAS IT
          YOU WON'T WANT TO MISS 'Alt-facts in logic'
        END OF STORY
        LIES! RUMOR HAS IT
          YOU WON'T WANT TO MISS 'Fake news are not discovered yet'
        END OF STORY
    
    PLEASE LIKE AND SUBSCRIBE
It prints that "FAKE NEWS ARE NOT DISCOVERED YET!", disappointingly enough.
Re:Tabloid: The Clickbait Headline Programming Language by edtechdev on Thursday September 24, 2020 @10:36AM (#24578980)
Arnold Schwarzenegger based programming language https://github.com/lhartikk/ArnoldC
Re:Tabloid: The Clickbait Headline Programming Language by Al-Khwarizmi on Thursday September 24, 2020 @12:22PM (#24580254)
Proposed extensions:

  Assert(x==0): YOU WON'T BELIEVE x IS ACTUALLY 0

  x<y: x GETS OWNED BY y

  Define a struct/record:

  2 THINGS YOU DON'T KNOW ABOUT A rectangle
    base
    height
Re:Tabloid: The Clickbait Headline Programming Language by kerblang on Thursday September 24, 2020 @11:16AM (#24579389)
Brilliant!

However: Ideally, someone would create a meta-language for defining the next ArnoldC/LolCat/Intercal/...Tabloid, assuming there will be a next, which I'm sure there is (nobody made a porn-based language yet, rule 33 or whatever number it was).

Re:Tabloid: The Clickbait Headline Programming Language by jtolmar on Thursday September 24, 2020 @01:59PM (#24581451)
I used to have a program that'd take eight arbitrary tokens and output a programming language using those as its commands, just as a reskin of Brainfuck (such as Ook).

My copy is long gone, but it's an easy project if you want to make one for yourself.

Re:Tabloid: The Clickbait Headline Programming Language by mhh__ on Thursday September 24, 2020 @01:30PM (#24581098)
Compiler-compilers (not just parsing) do exist although they seem to have practically died out a long time ago (much easier to do when all language worth spending money on were procedural and structural if you were lucky)
Re:Tabloid: The Clickbait Headline Programming Language by penne12 on Thursday September 24, 2020 @11:56AM (#24579876)
The configuration file should be a collection of hackernews headlines
Re:Tabloid: The Clickbait Headline Programming Language by bitwize on Thursday September 24, 2020 @10:51AM (#24579144)
It's cute, but a real language needs a lambda operator. I propose ONE WEIRD TRICK.
Re:Tabloid: The Clickbait Headline Programming Language by thesephist on Thursday September 24, 2020 @10:52AM (#24579150)
This is actually so good I might implement it when I get time later. It just makes sense.
Re:Tabloid: The Clickbait Headline Programming Language by 4cao on Thursday September 24, 2020 @10:54AM (#24579169)
Excellent!

> PLEASE LIKE AND SUBSCRIBE

(= END [of program])

How about YouTuBasic?

Re:Tabloid: The Clickbait Headline Programming Language by penne12 on Thursday September 24, 2020 @10:58AM (#24579220)
The parser should use TikTokenization
Re:Tabloid: The Clickbait Headline Programming Language by CornCobs on Thursday September 24, 2020 @11:34AM (#24579581)
Love this idea. Maybe you could add random value generation?

E.g. EXPERTS CLAIM <var> TO BE <type>. IT WILL SURPRISE YOU!

Re:Tabloid: The Clickbait Headline Programming Language by penne12 on Thursday September 24, 2020 @11:58AM (#24579910)
Needs async/await:

async: DEVELOPING STORY [DISCOVER HOW TO...]

await: STAY TUNED FOR [expr]

Re:Tabloid: The Clickbait Headline Programming Language by dTal on Thursday September 24, 2020 @01:25PM (#24581050)
I think "TOTALLY RIGHT" and "COMPLETELY WRONG" should be changed to "CONFIRMED" and "BUSTED".
Re:Tabloid: The Clickbait Headline Programming Language by mellosouls on Thursday September 24, 2020 @06:30PM (#24584430)
Apart from anything else, the website itself is a great intro to the language, terrific UX; fun, witty and focused.

Great job!

Re:Tabloid: The Clickbait Headline Programming Language by noiv on Thursday September 24, 2020 @12:00PM (#24579941)
Any one interested to start a Clickbait to React Transpiler?
Re:Tabloid: The Clickbait Headline Programming Language by darepublic on Thursday September 24, 2020 @11:35AM (#24579590)
can't wait for the NLP that can compile transcripts of the national inquirer into working code
Re:Tabloid: The Clickbait Headline Programming Language by kodeninja on Thursday September 24, 2020 @05:40PM (#24584007)
WHY I LOVE THIS--I've never laughed so hard while reading an HN post.

Great job!

Re:Tabloid: The Clickbait Headline Programming Language by anton96 on Thursday September 24, 2020 @10:39AM (#24579011)
I wonder what It would give with Nathan W Pyle's Alien.
Re:Tabloid: The Clickbait Headline Programming Language by annexrichmond on Thursday September 24, 2020 @12:16PM (#24580176)
You won't believe what's on line 7!
Re:Tabloid: The Clickbait Headline Programming Language by baltimore on Thursday September 24, 2020 @11:09AM (#24579320)