News for hackers. Stuff that matters.
Re:Introducing command And commandfor In HTML by QuadmasterXLII on Friday March 07, 2025 @12:51PM (#43292326)
While programming language theorists have been speculating about “goto”’s more powerful cousin “comefrom” since the 80s, it was only implemented in intercal. Intercal, while clearly superior in safety, performance, and ergonomics to languages like C, has struggled to break into the commercial market (likely because worse is better). It’s exciting to see javascript integrate this feature from intercal- hopefully this leads to a surge in polite programming, analogous to how javascript’s embrace of closure based objects has driven functiOOPnal programming into the mainstream
Re:Introducing command And commandfor In HTML by bunderbunder on Friday March 07, 2025 @04:00PM (#43294594)
Haha, I had completely forgotten about intercal and "comefrom".

Such genius. It anticipates and neatly summarizes the problems I've had maintaining and supporting code written using reactive programming design patterns by a good 40 years.

Re:Introducing command And commandfor In HTML by alterom on Friday March 07, 2025 @01:04PM (#43292451)
>hopefully this leads to a surge in polite programming

But not too polite. The compiler wouldn't like that.

Re:Introducing command And commandfor In HTML by esafak on Friday March 07, 2025 @01:42PM (#43292925)
Demure is the fashion these days, I'm told.
Re:Introducing command And commandfor In HTML by mock-possum on Friday March 07, 2025 @05:21PM (#43295433)
Very.
Re:Introducing command And commandfor In HTML by BobbyTables2 on Friday March 07, 2025 @06:54PM (#43296119)
Spoken like a bussin’ sigma that eats - no cap.
Re:Introducing command And commandfor In HTML by krapp on Friday March 07, 2025 @08:46PM (#43296773)
Word to your mother.
Re:Introducing command And commandfor In HTML by SAI_Peregrinus on Friday March 07, 2025 @01:34PM (#43292825)
Of course not. Sycophantic code is quite grating.
Re:Introducing command And commandfor In HTML by fuzztester on Friday March 07, 2025 @06:10PM (#43295840)
what's the download site for the psycho-fantic language? gimme! puhleeze.
Re:Introducing command And commandfor In HTML by fuzztester on Friday March 07, 2025 @05:44PM (#43295616)
Well, at least the Boo compiler would not.

https://en.m.wikipedia.org/wiki/Boo_(programming_language)

Re:Introducing command And commandfor In HTML by jayd16 on Friday March 07, 2025 @02:27PM (#43293466)
Maybe I'm lost about the greater theory here. As a non-js dev it looks like they're just adding some OO sugar to events. I hesitate to call it sugar because it seems a lot more verbose than "my-menu.show-popover()" but its better than a global listeners I suppose.
Re:Introducing command And commandfor In HTML by gmueckl on Friday March 07, 2025 @02:55PM (#43293813)
COMEFROM is one of the many great jokes that form the Intercal language. I recommend reading the language specification.

Of course, COMEFROM's grown up (and very real) sibling is ALTER GOTO in COBOL.

Re:Introducing command And commandfor In HTML by Voultapher on Saturday March 08, 2025 @07:05AM (#43299539)
So I tracked down this programming manual for intercal https://3e8.org/pub/intercal.pdf and can't locate any mention to comefrom.
Re:Introducing command And commandfor In HTML by mannykannot on Saturday March 08, 2025 @01:29PM (#43302279)
It is from a dialect called C-INTERCAL and is written with a space: 'COME FROM'

https://www.cs.virginia.edu/~asb/teaching/cs415-fall05/docs/...

Re:Introducing command And commandfor In HTML by gmueckl on Sunday March 09, 2025 @01:06AM (#43306684)
Thanks for that correction! I had memorized COME FROM as part of the original Intercal. My mistake.
Re:Introducing command And commandfor In HTML by twic on Sunday March 09, 2025 @08:48PM (#43315655)
It's also foundational in Threaded INTERCAL, where "multiple COME FROM statements with the same label cause the program to fork separate threads at each COME FROM":

https://esolangs.org/wiki/Threaded_INTERCAL

Re:Introducing command And commandfor In HTML by eyelidlessness on Friday March 07, 2025 @08:24PM (#43296646)
That’s a reasonable analogy, but I think the more novel and interesting thing about this is that it’s:

- A declarative mechanism to relate one element to another

- With a range of semantics for declaring interactivity invoked through their relationship

- At a high level, with explicit guarantees of consistent accessibility and UX

In a lot of ways, this looks a lot like what people describe when they wish for more HTML and less JS. (Except for the extreme-minimalist version of that which rejects web interactivity altogether.)

Re:Introducing command And commandfor In HTML by DonHopkins on Friday March 07, 2025 @02:00PM (#43293103)
Not to mention reversible computing's "gofrom" and "cometo".
Re:Introducing command And commandfor In HTML by toomim on Friday March 07, 2025 @02:52PM (#43293784)
comehither
Re:Introducing command And commandfor In HTML by edoceo on Friday March 07, 2025 @06:10PM (#43295837)
FromYonder
Re:Introducing command And commandfor In HTML by yellowapple on Friday March 07, 2025 @10:43PM (#43297307)
whence
Re:Introducing command And commandfor In HTML by vonunov on Sunday March 09, 2025 @01:42AM (#43306826)
After y'all've had such great success with the Stacked Contractions movement starting in 2017 -- which I would like to take credit for independently spearheading on the Neopets forums in the mid-2000s, but I'dn't've been able to do it all myself of course -- I'd like to propose our next campaign.

Let's bring back pronominal adverbs! You may already be familiar with such classics as "therefore" or "whereas". Why not revive all of them? No longer are "hereunder" and "thereinafter" the sole domain of lawyers. That alone would be an epic meme indeed, but we must go therebeyond. It is difficult to believe that anyone ever actually used words like "therethroughout" or "wherewithin", but we can make sure someone does.

You can even make up your own!

Just take any demonstrative (this/that/these/those), interrogative (what/which/who/where), or third-person personal pronoun, and turn it into the corresponding locative adverb, depending on whether you want to indicate being at, coming from, or going to something:

This -> Here/Hence/Hither;

That -> There/Thence/Thither;

What/who/which -> Where/Whence/Whither;

Him/Her/Them -> There/Thence/Thither; etc.

Makes sense? No questions? Great!

Now pick your favorite preposition and stick it on the end. Don't forget to experiment with some archaic prepositions like "anighst", "overthwart", and -- here's a really good one -- "withinside". That one means "within / inside" and I'm sure you can already see the potential.

"What place should I go into?" Nope! "Whitherwithinside should I go?" Now we're talking.

Re:Introducing command And commandfor In HTML by fuzztester on Friday March 07, 2025 @06:24PM (#43295921)
>reversible computing's "gofrom" and "cometo".

wowza, oops, i mean, wow, sir.

you inspired me to respire more deeply.

from which comes an irreversible desire to learn, deeply, about deep learning.

Re:Introducing command And commandfor In HTML by mindcrime on Friday March 07, 2025 @06:40PM (#43296017)
My new language is going to include thataway, overyonder and uptown constructs.
Re:Introducing command And commandfor In HTML by DonHopkins on Friday March 07, 2025 @08:36PM (#43296708)
2 the !!boogie, say(^jump the boogie)
Re:Introducing command And commandfor In HTML by vonunov on Saturday March 08, 2025 @04:18PM (#43303631)

  for (let i = 1; i <= 4; i++) {
      woman.getOn(floor);
      try {
          getDown();
      } catch (e) {
          if (e instanceof NotUpError) {
              getUp();
              getDown();
          }
      }
  }
Re:Introducing command And commandfor In HTML by chrismorgan on Saturday March 08, 2025 @01:09AM (#43297903)
Given that “come to” means “regain consciousness”, this pair sounds like it should be about thread sleep control.
Re:Introducing command And commandfor In HTML by stonogo on Friday March 07, 2025 @05:02PM (#43295246)
Perl has supported comefrom for decades! https://metacpan.org/pod/Acme::ComeFrom
Re:Introducing command And commandfor In HTML by fuzztester on Friday March 07, 2025 @06:30PM (#43295959)
b-b-but ... does Perl support Sanskrit? if not, I hope at least Raku does.

with its grammar feature, it well might, or might as well.

https://en.m.wikipedia.org/wiki/Raku_(programming_language)

https://en.m.wikipedia.org/wiki/Sanskrit

Re:Introducing command And commandfor In HTML by chuckadams on Friday March 07, 2025 @08:35PM (#43296699)
Sanskrit is written in Devanagari script which is used by nearly a billion people, so any language that groks Unicode identifiers should handle it fine. You want to pose a challenge, maybe try something like Rongorongo or Klingon. Me, I want to write my code in actual hieroglyphics.
Re:Introducing command And commandfor In HTML by shakna on Friday March 07, 2025 @08:57PM (#43296834)
TeX will allow you to rewrite the parser (ala TeXInfo), and using a unicode engine will allow you to use UTF.

TeX will also allow you to embed and force fonts.

Final step: Use something like Lyx, that will let you write and see the embedded font.

Re:Introducing command And commandfor In HTML by fuzztester on Friday March 07, 2025 @10:25PM (#43297222)
wow. what a number of errors in your comment:

intro:

you are talking to an Indian who lives in India, and who knows Hindi (a language derived from Sanskrit) fluently (and has been complimented multiple times for his Hindi speaking ability by native Hindi speakers), and who has studied Sanskrit for 3 years in high school and then 2 years in college, and Hindi for 4 years in high school, including grammar, vocabulary and literature (both poetry and prose) in both languages), and also essay-writing in Hindi. and got a high score in class in both those languages, over all the years that he studied them.

and who has spoken Hindi for much of his adult life.

both those languages are written in Devanagari.

>Sanskrit is written in Devanagari script which is used by nearly a billion people, so any language that groks Unicode identifiers should handle it fine.

whether the (programming) language can grok Unicode, has nothing to do with the number of people who use either Sanskrit or Devanagari, so your statement lacks logic, overall.

you said:

>Sanskrit is written in Devanagari script which is used by nearly a billion people

that statement shows ignorance of actual facts.

here is why:

I had an idea about these points informally, already, being an Indian who lives in India, but I still did a few quick googles, to verify:

List of languages by number of native speakers in India:

https://en.m.wikipedia.org/wiki/List_of_languages_by_number_...

Demographics of India:

https://en.m.wikipedia.org/wiki/Demographics_of_India

https://www.google.com/search?q=number+of+people+who+use+dev...

top paragraph of the results of the above search:

>Today, the Devanagari script is used to write three major languages: Hindi (over 520 million speakers), Marathi (over 83 million speakers) and Nepali (over 14 million speakers).

even if you add the number of people in the Indian diaspora, such as in Fiji, the Caribbean, etc., you will not come to nearly a billion.

you made a wrong assumption:

> You want to pose a challenge, maybe try something like Rongorongo or Klingon.

you assumed that I was posing a challenge. I was not.

you seem to have not recognised that my comment was made in jest:

>b-b-but ... does Perl support Sanskrit?

Re:Introducing command And commandfor In HTML by chuckadams on Saturday March 08, 2025 @10:55PM (#43306051)
Dude, I don't think you're capable of jest. Get some therapy.
Re:Introducing command And commandfor In HTML by fuzztester on Thursday March 13, 2025 @08:01PM (#43358446)
Double dude, your pathetically weak thinking, and even more, your obviously inferiority-complex-ridden nature, which is evidenced by your trying (unsuccessfully) to strike out viciously at others who make knowledgeable, reasonable and innocuous comments (see mine above, to which you replied in your ugly wrong way), show your overall utter sickness and poverty, mental, physical and emotional.

first of all, I am posting again one of my earlier comments in reply to you:

https://news.ycombinator.com/user?id=fuzztester

let the whole world see it, and know you for the kind of guy you are, chuckadams, you creep, fake, ignoramus and liar.

acting (faux) scholarly and trying to tell me things (which are totally wrong) about my own country and culture, you jackass. you are laughable.

fool. everyone here noticed that you "cleverly" avoided replying to any of my above points, and instead tried to divert the topic by trying to insult me, you fuckhead and fucktard:

>I don't think you're capable of jest. Get some therapy.

hee hee hee.

not just me, no sane or decent person is interested in the opinions of a retard like you, except other retards like you, of which I know there are many, so some are sure to downvote my comment, but who the bloody fuck cares for votes or opinions of others, except losers like you and your friends, who I am sure you will encourage to waste their unvaluable time in downvoting, because laid off and no work and little money left, right? There are tons of recent posts on HN about all the people feeling the pain of no jobs and no money, which situation is partly if not largely due to the brain-dead shenanigans of jokers like you, who kept on demanding unsustainable raises, for years (which is why your jobs went to India), and job hopping for the same, which has now finally ended in so many of you guys being kicked out of your comfy, highly overpaid jobs, so that now you are on the street, scrabbling to make ends meet.

you are not capable of anything good, only of rotten shit! :)

I am fine. You need much more than therapy. you need a life, and to have interest in it. until then you will be as unhappy as you are now.

now, fuck off, you pathetic excuse for a human being.

don't waste your time insulting others gratuitously.

:) Google the double meaning (1 and 2) of that last word, or if you are unable to do it, swallow this crumb, dog:

https://www.dictionary.com/browse/gratuitously

and I don't give a flying shit if I am banned for this comment, because you started it, with your 2 ugly comments above, and because who gives a shit about hn in the real world anyway). let the whole world know how discriminatory HN is, with a very western-favoring slant, if not outright racism towards Indians, Asians, etc., by comment posters, voters and moderators.

Re:Introducing command And commandfor In HTML by hyperdimension on Friday March 14, 2025 @09:59AM (#43362720)
Wow.
Re:Introducing command And commandfor In HTML by chrismorgan on Saturday March 08, 2025 @01:18AM (#43297947)
Sanskrit can be written in the Devanagari script (and these days most commonly is). But it does not have an attested native script <https://en.wikipedia.org/wiki/Sanskrit#Writing_system>.

But still, so long as it’s a script in Unicode, it should all work fine.

Re:Introducing command And commandfor In HTML by fuzztester on Saturday March 08, 2025 @08:43PM (#43305369)
>Me, I want to write my code in actual hieroglyphics.

snarky / slimy, discriminatory comment, much? not to mention highly ignorant, as I said in my sibling comment.

I took a look at your comment history.

seems to prove what I said about your attitude.

creeped out by it.

Re:Introducing command And commandfor In HTML by fuzztester on Friday March 07, 2025 @05:41PM (#43295600)
cough I hereby propose two new language constructs and corresponding keywords, which can be applied (sounds more functional than implemented,) widely across many languages, at least procedural / imperative ones:

goto and comefrom

with optional synonyms:

leave to and return from

the above can be shortened to as little as two letters each:

go and co

le and re

for fans of succinctness / conciseness.

PRs are open.

Re:Introducing command And commandfor In HTML by fc417fc802 on Friday March 07, 2025 @06:05PM (#43295790)
> with optional synonyms

Leave I follow, but doesn't "return from" rightly describe a continuation as opposed to "come from" which is a nonlocal goto?

Re:Introducing command And commandfor In HTML by fuzztester on Friday March 07, 2025 @06:33PM (#43295978)
I stopped understanding continuations before I even started.
Re:Introducing command And commandfor In HTML by fc417fc802 on Saturday March 08, 2025 @03:25AM (#43298543)
I can't quite tell if you're serious. Continuations are fun, so I'll post this on the off chance it helps someone.

They are perplexing until they aren't. Model stack frames as independent state. When you return from a function the stack frame can stick around. Now later, place your stack pointer back in the frame that you returned from earlier.

Add a convention for passing arguments when you update the stack pointer as above. Now you have continuations.

Re:Introducing command And commandfor In HTML by bryanrasmussen on Saturday March 08, 2025 @06:00AM (#43299224)
so you can place your stack pointer back in the frame that you returned from earlier? that's probably the point at which they stopped understanding continuations before even starting.
Re:Introducing command And commandfor In HTML by cyco130 on Saturday March 08, 2025 @08:09AM (#43299967)
That’s the tricky part. There’s no stack anymore. Activation records of functions are heap-allocated and can stick around as long as necessary.
Re:Introducing command And commandfor In HTML by fc417fc802 on Saturday March 08, 2025 @09:23AM (#43300462)
To be fair it's still a stack (the data structure). It just isn't contiguous in memory anymore.

Of course modern LLVM already breaks it up into chunks anyway (given certain flags at least) so it likely isn't contiguous regardless.

Re:Introducing command And commandfor In HTML by bryanrasmussen on Sunday March 09, 2025 @01:51AM (#43306873)
I was explaining the joke? Since the person I was replying to seemed to wonder if it was really a joke, whereas for me, structurally it was obviously a joke.
Re:Introducing command And commandfor In HTML by zaphirplane on Friday March 07, 2025 @10:28PM (#43297232)
That’s funny i read it as a dead pan joke Til
Re:Introducing command And commandfor In HTML by ncr100 on Friday March 07, 2025 @11:06PM (#43297424)
Yeah, agreed. It is dripping heavily with nerd.
Re:Introducing command And commandfor In HTML by harrison_clarke on Saturday March 08, 2025 @12:18AM (#43297689)
C# has COMEFROM, too: https://github.com/dotnet/roslyn/blob/main/docs/features/int...

they make it cumbersome to use by hand, but not impossible

Re:Introducing command And commandfor In HTML by weeksie on Saturday March 08, 2025 @08:03AM (#43299921)
This is beautiful.
Re:Introducing command And commandfor In HTML by Thorrez on Saturday March 08, 2025 @10:31AM (#43300961)
How are command and commandfor similar to comefrom?

They seem similar to goto to me. With goto, the trigger specifies what to do. That's what command and commandfor do.

With comefrom, what to do specifies the trigger. That seems similar to the existing document.addEventListener() in Javascript.

Re:Introducing command And commandfor In HTML by ancyrweb on Sunday March 09, 2025 @11:42PM (#43316800)
I don't see either. It's not even similar to goto. It's nothing more than method invocation, which is nothing like goto.
Re:Introducing command And commandfor In HTML by btown on Saturday March 08, 2025 @02:07PM (#43302603)
Python implementation (not mine) for comefrom and goto, so old it predates a pypy package - and very much for good reason! https://entrian.com/goto/