3 ms·
It feels like Pascal in Cyrillic. Autotranslation, with a little manual correction, but I can't fix КНЦ (autotranlated to KNC): FUNC FACT (N); NAME: R;
by gus_massa 5mo ago
It feels like Pascal in Cyrillic. Autotranslation, with a little manual correction, but I can't fix КНЦ (autotranlated to KNC):
FUNC FACT (N);
NAME: R;
1 -> P;
FOR I FROM 1 TO N ::
R * I -> R
ALL
RES: R
KNC;
FOR N FROM 0 TO 6 ::
? "FACT(", N, ") = ", FACT(N)
ALL;
- gus_massa 5mo ago[flagged]
- dijksterhuis 5mo agohttps://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html > Don't post generated comments or AI-edited comments. HN is for conversation between humans.
- yeputons 5mo agoI would read «КНЦ» as «КОНЕЦ», literally “an end” or “the end” (Russian does not have anything resembling articles). Who needs vowels, anyway. Also, «ВСЕ» feels like «ВСЁ» in this context, I’d translate that as “that’s all”.
- varjag 5mo agoThe acronyms are because it was originally russified by substituting character codes in Pascal binary. Thus VAR became ИМЯ, END became КНЦ and so on. Same reason JOB hilariously became ЗАД in the liberated OS/360. Everyone's happy, head of development celebrates his 3rd degree Lenin's premium.
- orbital-decay 5mo agoIs it really Pascal though? There's a lot of academic/educational languages with the similar syntax, and I think РАПИРА had additional data structures. (I've read a book on it and tinkered with it as a kid, but it was in the early 90's and I barely remember any of it)
- gus_massa 5mo agoIt uses :: instead of BEGIN, so it's not 100% Pascal.
- deleted 5mo ago[deleted]
- vbezhenar 5mo agoFew fixes: 1. "ИМЕНА" is plural, so instead of "NAME:" it's a bit more appropriate to use "NAMES:". Probably should be "VARIABLES" or "VARS" in modern context. 2. You've got few typos mixing "R" and "P". Should be "R" everywhere. 3. Instead of "ALL" you should use "DONE". 4. Instead of "KNC" you should use "END". So it would look like this: FUNC FACT (N); NAMES: R; 1 -> R; FOR I FROM 1 TO N :: R * I -> R DONE RES: R END; FOR N FROM 0 TO 6 :: ? "FACT(", N, ") = ", FACT(N) DONE;
- xxs 5mo ago>It feels like Pascal in Cyrillic replace cyrillic w/ russian and it'd be ok. КНЦ = end (конец in russian is end). However, in bulgarian in means 'thread' (as in sewing thread) and it has lots its meaning of end, aside from 'from needle to thread' expression where it means from the tip of the needle to the end of the thread. Also 'ALL' (и все = it's over/that's all), which should be 'end' as in begin/end in pascal. The main point still stands - it's Pascal.
- stodor89 5mo ago> However, in bulgarian in means 'thread' You can use "конец" for "end" in Bulgarian too, even though it's antiquated.
- bojan 5mo agoBeing Serbian, I also find equalising Cyrillic with Russian mildly annoying. Or even worse, when people call it "Russian letters". With that being said, I do think it's harder to make a clear programming language based on is a Slavic language, due to all the case and gender forms.
- dimava 5mo agoSince I know russian well, here's a proper translation for y'all FUNC FACT (N); NAMES: P; (* variable names *) 1 -> P; FOR I FROM 1 TO N :: P * I -> P DONE (* endif *) RET: P (* return value *) END; (* end of function *) FOR N FROM 0 TO 6 :: ? "FACT(", N, ") = ", FACT(Н) (* print *) DONE;
- deleted 5mo ago[deleted]