Special snowflake languages

Why are some programming language different just for the sake of being different?
Is there a technical explanation for using different things than what has been established in c/c++/java?

Stuff like
~= instead of !=
:= instead of =
%s instead of \s
1 indexed instead of 0 indexed

Other urls found in this thread:

lysator.liu.se/c/clive-on-bcpl.html
cap-lore.com/Languages/Algol68.html
fortran90.org/src/faq.html
en.wikipedia.org/wiki/True_and_false_(commands)
github.com/michaeldv/ante)
en.wikipedia.org/wiki/Shakespeare_(programming_language)
youtu.be/PbdDMWognH4
catb.org/esr/faqs/things-every-hacker-once-knew/
doc.rust-lang.org/reference/tokens.html#number-literals
en.wikibooks.org/wiki/Ada_Programming/Lexical_elements#Numbers
cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF
esr.ibiblio.org/?p=7294
esr.ibiblio.org/?p=7380
fortran90.org/src/faq.html#what-is-the-most-natural-way-to-handle-initial-and-final-points-of-intervals
esr.ibiblio.org/?p=208
docs.freebsd.org/cgi/getmsg.cgi?fetch=585008 0 archive/2001/freebsd-arch/20010218.freebsd-arch
pyropus.ca/software/getmail/faq.html#faq-about-why
groups.google.com/d/msg/comp.arch/GUA7AtDPy84/U4y8Squ7gScJ
internals.rust-lang.org/t/how-are-negative-int-float-literals-handled-during-lexing-parsing/3120/2
github.com/rust-lang/rust/pull/3050818
twitter.com/SFWRedditImages

More similar to ¬=, so it makes more mathematical sense.
Using plain = for assignment was a mistake. You're making something equal, not discussing whether it was already equal. A different assignment operator is a good idea.
What are you talking about here?
0 indexed makes sense when a[b] is syntactic sugar for *(a + b), but 1-indexing has nice properties like a[len(a)] being a's last element. I haven't programmed enough in 1-indexed languages to be sure, but it seems like it could prevent some off-by-one headaches. I don't know if it's better, but I think it's worth exploring.

Keep in mind that programming might stick around for thousands of years, but we've only been doing it for a few decades. We still have an opportunity to get it right, try new things, see what sticks. Please don't let design mistakes from fifty years ago affect computing forever. Syntax affects your thinking.

Hoon is the most special of snowflakes. There are no functions, only 'gates'. There are no expressions, only 'twigs'. 0 is true and 1 is false. For the most part, whitespace is not significant, except one space character is treated differently than more than one space character. There are multiple entirely new indentation patterns. There are no reserved words, every builtin operator and construct is a combination of two ascii characters, called a 'rune'.

C is the special snowflake language. All of the ones on the left were used before C existed. A lot of things in C came from BCPL and were changed. The C people also changed # and #x into 0 and 0x for octal and hexadecimal. If starting a number with 0 changing its base isn't special snowflake, I don't know what is.
lysator.liu.se/c/clive-on-bcpl.html

They got the idea of function types from Algol 68, but the Algol 68 is straightforward left to right, and also has lambda expressions as the only way of defining functions. I can't mention that without also saying the Algol 68 union is type safe and based on set theory, and not a low-level systems programming concept. It also has a default of 1 for arrays and loops.
cap-lore.com/Languages/Algol68.html

That's a problem with education. They teach that C is an incredibly important language and if C does something bad, it's because it came first and other people improved upon it. Usually it's the other way around.


1-indexed arrays and inclusive bounds make more sense to me. After using Ada, where you can do things like Monday..Friday, the exclusive upper bound is just stupid. It's only an excuse for why a 10 in the loop means you iterate 10 times. 1 to 10 is nicer than 0 to less than 10. It means you can loop across the whole range of a type without worrying about overflow.

1-based arrays are about people and human conventions. Early programming concepts were based on what people did before we had computers. People built hardware to solve real world problems. That's what high-level languages are about. 50s Fortran wasn't very high level compared to today's languages, but it was designed to be used by mathematicians, engineers, and scientists, not "programmers." The conventions and syntax in Fortran, Algol, and Cobol were intended to be understood by people who never used computers or programming concepts. Back then, that was your user interface.

If you need any more reasons, read the Fortran FAQ.
fortran90.org/src/faq.html

The C and Unix people created design mistakes that weren't there before and aren't there in languages still used in today! That's what's so horrible about it. It's another education problem.

People in the 50s and 60s knew this. Syntax is about people, not parsing.

APL. You should get a special keyboard for muh symbols.

Now really a language, but Bloomberg Terminals are special snowflake computer systems. With their own keyboard layout. Not that you need to worry about one goyim, it costs $20,0000/user/month to operate one of these. Shabbat shalom.

What are the programs they use written in?

Fortran and C.

Those languages inherit a different set of traditions coming from different, now more obscure standards.
It has nothing to do with being different for the sake of it you paranoid fuck.

Enjoy the downfall of civilization and the financial system.

The only language I've used with 1-based arrays is Smalltalk, but there you access elements using the at: method, which is supposed to look like natural language instead of programming, so it makes sense to access "the first element of array" at position 1

huehue

It does. It inherits much of its syntax and semantics from a bunch of non-C languages that came before it. What are you trying to say?

tbf that's a pretty unixy way of doing things
en.wikipedia.org/wiki/True_and_false_(commands)

Bring back PL/1 or fuck you

1 indexed arrays seem more useful until you try to do anything half way complicated with them then you end up with a mess.
>for i=0; ifor i=1; i

I don't really understand what your example is supposed to do, but the second one is definitely not the simplest, most obvious way to do it with 1-indexed arrays.
>for i = 0; i < n/x a[i*x+1]
Can you explain what you're trying to demonstrate?

that it's not "more natural" to start indexing from 1

I mean, can you explain what those examples are supposed to do? Can you show some realistic-looking code that uses it? I don't understand your examples.

lol fuck off retard

no u :^) XDXDXDXD

Not him, but using an array as a circular data structure, that is, you insert at the end and when you reach the array size you wrap back to the beginning, is an example of an application where 1-indexed arrays have a subtle caveat:

0-index: a[i%size] = element; ++i
1-index: a[(i%size)+1] = element; ++i

I know that it looks like bullshit, but if off-by-one issues were that simple there wouldn't have been decades of buffer overflow exploits

That makes sense. Of course there are cases in which 0-indexing is more natural. But that doesn't necessarily mean that 0-indexing is more natural in the majority of cases.

If only there were languages that would let you choose any range of any discrete type to index your array's.

You could also do it by resetting the counter.

0-index: a[i] = element; if i = length(a) - 1 then i = 0;

1-index: a[i] = element; if i = length(a) then i = 1;

That's worse than forcing either of them, because you then have to keep in mind what kind of array you're dealing with, and if you forget you end up making mistakes. It gets especially bad when you're working with code someone else wrote.

you really are brain dead


oh right wrapping around an array makes sense but accessing every nth element is so out there that you can't even imagine it. holy fuck

...

Thank you, that was the explanation I was looking for.

This is client side investor tier software. You understand that right?

Sure, but the example was mostly to show how with 0-indexes you can use the properties of modulus to accomplish the task
And as rightfully points out, both types of indexing have places where they are more natural and others where they don't


There are languages in which ranges are a built-in type, for example matlab/octave
Not sure they are what you are looking for though, since I don't really understand you

...

...

Rust programmers annoy me more than vegans, even though I suspect there is considerable overlap.

Whenever I feel the need to do this, I just define a modulo integer type for the index that handles the wrapping around for me.

Go's syntax is my favorite so far.

That's the plan.

Being able to index dependent on application can make code easier to understand. And besides that, you don't even need to mentally keep track of the index.

procedure Main is A : array (0 .. 5) of float := (others => 3.14); B : array (1.. 6) of float := (others => 3.14); begin for foo in A'Range loop put(Float'Image(A(foo))); end loop; for foo in B'Range loop put(Float'Image(B(foo))); end loop; for foo of A loop put(float'Image(foo)); end loop; end Main;

Besides 'Range, you have 'First 'Last 'Length etc etc


Something like this
procedure Main is type distros is (Genoo, Slackware, Debian, Funtoo, Redhat); subtype Pozzed is Boolean; Type PozzArrayType is array(distros) of Pozzed; PozzArray : PozzArrayType := (others => False); Type FloorLevels is range -2 .. 9; FreeSpace: array(FloorLevels) of Natural; begin --We all know Redhat is Pozzed, lets fix it PozzArray(Redhat) := True; -- Prints the numbers -2 to 9 for floor in FloorLevels loop put(FloorLevels'Image(floor)); end loop; --Set the free space on each level to 42 For floor in FloorLevels loop FreeSpace(floor) := 42; end loop; end Main;

They actually serve a practical purpose, i.e. being used to make lots of money, so they're not as "special snowflake" as a language used to circlejerk about your own intelligence

...

C is special snowflake.

Everybody else has a start, step, end loop and Ctard special snowflakes redefined it to their stupid crap. Rust snowflakes think you need to "abstract" over "for loops" because of the C special snowflake crap. The loop is already an abstraction!

I use R and this the most cancerous shit ever. I get that the idea is to make programming "less confusing" but:

A. That ship has sailed decades ago
B. There were valid reasons for doing it in the first place and they still apply
C. Nobody with an IQ over 80 actually finds this confusing or hard to remember unless it's literally their first week of cs101

What's worse is that R lets you use both = and ->. You can tell the fags who insist on using -> are literally being snowflakes, it's "muh pronouns" tier behavior. But on the bright side sanity is only a search&replace away, so fuck those shitheads.

Well op there are also some languages that spawned from(and mostly still are) some random guy thinking 'can I make this work' and then going full autismo over it some examples are
Brainfuck which you should know about already
>Ante (github.com/michaeldv/ante)
The language that can be written using a deck of playing cards where suits are operations.(♠ subtracts and ♥ multiplies etc)
>Shakespeare(en.wikipedia.org/wiki/Shakespeare_(programming_language) )
The language made to look like a play and has the variables enact dialogue with eachother
There are also ones like Piet where in the program is actually stored as a bitmap image and it ends up looking like pixel art by the time you are done or Malbolge,named after the 8th circle of hell, which was specifically designed with the goal of inducing maximum suffering

I know that this isn't exactly what you meant but I find that things such as these are an interesting topic to explore

...

This.

Anyway, OP:

This can be important in differentiating equality from assignment. In Pascal, equality is = and assignment is :=, while in C, equality is == and assignment is =. For Pascal, it was about being an obnoxious hipster, because, unlike C, and like Fortran and Basic, assignment is a statement and thus X = Y = Z means compute if Y is equal to Z and store that boolean value in X. In C, they need to be differentiated because assignment is an expression (that was a stupid fucking idea) and assignment is done more frequently than testing for equality.

I actually like the Pascal/Basic version: . X Y can be read "X is greater than or less than Y", which is true when X and Y are numbers and X is not equal to Y.

Is far more natural for humans. There is nothing logical that the first character of a string is at index zero, and if you think otherwise, you are an idiot. Zero indexing is about making the language match implementation.

ColorForth is the most snowflake of languages.
1. OR now means XOR
2. IF no longer consumes its argument
3. ';' no longer ends a function, it just compiles a jump or return. You can continue to the next function, giving you multiple entry points
4. use colors instead of 'syntax'
5. in 256-byte blocks
6. oh yeah and use my subset of dvorak
7. and run on a floppy
8. and run as OS on this one exact x86 setup

example of #3 (in otherwise Forth-like code, since I can't show you ColorForth without colors):
: checked-x! ( x -- ) dup 10 >= abort" tried to set x out of bounds": x! ( x -- ) x ! ;

2-3 aren't bad. 4 is cute but loses most of its effect when you format code normally and not in one contiguous block without newlines or spacing. 5-8 is "my ideas are so cool that I'm going to even begin to try and sell you on them"-tier. 1 is enraging.

the only thing that pisses me off is java
you made this fucking object so fucking special you forgot to make it a fufcking lower cae

Class names start with capital letters, and primitive types are all lowercase, right? Seems sensible. I don't know why you'd want them to make a single class break with this rule, seems like a terrible idea.

The fuck kind of name is """"""""JAVA""""""""

or Python?

hey all sound like kid-shit, grow the FUCK up and use abbreviations or something. Like Rst-2. Or C. Or TTJ4. Or something like that.

I can't fucking explain what I do without people going WTF..................

C is not an abbreviation. It was named "C" because it's the letter that came after "B". It's the kind of name you use when you just started learning the alphabet and you're extremely proud of yourself.

x youtu.be/PbdDMWognH4

bash is an abbreviation: bourne again shell
a joke on Bourne, the surname of the guy that made the first shell for Unix and "born again" as in being rewritten with added features

Yeah, but most people don't know that.

That's stupid and you know it.

Why does that matter at all?

I don't like that fact either.

edgy teen detected

yes, but those names are childish.

I see you don't know about ALGOL, a quite influential language back in the day. The Pascal ':=' assignment syntax comes from there.

Honestly, C having both '=' and '==' should have been a big red flag right off. Much the same way that javascript and PHP adding yet another level with '===' is a red flag.

That's not like javascript and PHP's ===, because = and == are not different levels of the same thing. They're very different things. Not that that makes it any better.

How the fuck is it stupid? It's a good pun on the original Bourne shell. Are puns not allowed now? And then you differentiate yourself from the pro-censorship guys?

grow the FUCK up

looks like youve got some growing up to do there yourself user

let me help you with that

Welcome to the cuckchan shitpost thread. Please leave your sense at the door and get ready to cringe

...

I'm at about the point where I can't handle it anymore

The more you know.... However, it appears that Algol 68 had to differentiate between assignment and equality for the same reason C does: assignment was an expression. As far as I can tell, Pascal made assignment to a statement, so it doesn't need to make that distinction. Retaining that distinction is, for it, being an obnoxious hipster.


So very true.


The point is the grammar shouldn't allow the ambiguity. Apparently, Algol also had a ':=:' that represents another take at equality. They are only needed because the language does too much magic behind the scenes.

But assignment and equality are two completely different things. Why would you give them the same operator? Have your conceptions been tainted by using the = sign for assignment?

There is no reason why assignment should have been given the plain = sign in the first place. ← is very sensible but unfortunately impractical.

1st bitch is fat
2nd bitch has fake tits and looks like an orange, not to mention she's not even white.
3rd one is a bimbo

So are you about to cum?


First two are wrong, if you think the fist bitch is fat then you're projecting your own fatness.
Second one is god-tier.
Thirs is a bimbo, yes. But a good one.

I get mad every time I remember Ruby's "elsif".

shit, mods deleted it?
whoever posted it, do you mind posting it on another board? Like /test/? Sage for offtopic

Well, "

Do you really want me to?

...

Why? That isn't special snowflake at all. That's just mimicking Perl. Before the community defeated matz, Ruby was basically a faithful Perl6.

They've made quite a lot of garbage posts in this thread. Can you spot them all?

catb.org/esr/faqs/things-every-hacker-once-knew/

rust masterrace reporting in
doc.rust-lang.org/reference/tokens.html#number-literals

That's cute.
en.wikibooks.org/wiki/Ada_Programming/Lexical_elements#Numbers

no thanks. you can do that with macros.

I always love seeing Ada posted here.

Lua is the sanest "modern" scripting language. 1-based arrays, a real for loop (not C's "while loop in disguise"), no curly braces, and beginning a number with 0 doesn't change the meaning of the number. Lua is a lot smaller too.


There's a positive correlation between 0-based arrays, octal numbers beginning with 0, and bad language design. That's because C itself is bad language design.

...

1-based "arrays", a "real" for loop, end, 1.0 = 1, global scope is default

cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF

I can't read Lua for some reason. It's syntax just makes me want to throw up.

I might have been ill when I first came across it or something, like when you go off certain types of food.

As irrational as it is, I feel the same regarding OCaml.

Rust severely disappoints me
esr.ibiblio.org/?p=7294
The simplest possible method syntax in C
esr.ibiblio.org/?p=7380

Fortran, Algol, Cobol, PL/I, Pascal, Ada, Lua, Haskell, etc. are right and C and Dijkstra are wrong.

Dijkstra titled his essay wrong. He never explains why numbering should start with 0. He said that if numbering starts with 0, the upper bound should be excluded. Then he says that if you exclude the upper bound, numbering should start with 0. That's circular reasoning. If you include the upper bound, which is the most natural, numbering should start with 1.

fortran90.org/src/faq.html#what-is-the-most-natural-way-to-handle-initial-and-final-points-of-intervals

If you mean the numbers 2, 3, ..., 12, you say numbers from 2 to 12. You don't say 2 to 13, 1 to 12, or 1 to 13. Those are all nonsense. If a place is open on Monday, Tuesday, Wednesday, Thursday, and Friday, you say it's open Monday to Friday, not Monday to Saturday. When you count from 1 to 10, you start with 1 and end with 10, not start with 1 and end with 9.

In Haskell when you write [2..12] (meaning enumFromTo 2 12), you get the sequence 2 to 12. When you can use enums, not just numbers, this is the only way that makes sense. [Monday..Friday] has one common meaning.

For an empty sequence, you write 1..0. It can also be any number less than the lower bound, like 1..-10, 2..1, 100..0. These are all empty sequences. Just like when you write a loop for i = 1 to 0 or for i = 60 to -10, which execute 0 times. For an array with N elements, the bounds are 1..N. For a loop that repeats N times, the bounds are 1..N.

esr is literally retarded. why would i care what he has to say about rust?
rtfm
what is mio?

esr.ibiblio.org/?p=208

docs.freebsd.org/cgi/getmsg.cgi?fetch=585008 0 archive/2001/freebsd-arch/20010218.freebsd-arch
pyropus.ca/software/getmail/faq.html#faq-about-why

groups.google.com/d/msg/comp.arch/GUA7AtDPy84/U4y8Squ7gScJ

You just answered your own question.
Yes, there is a technical explanation, it's because the language isn't some bullshit made by someone who's only ever seen C and doesn't even really understand C (*cough* PHP, Java) and clueless about PL design in general. /thread

I get mad every time I encounter new versions of elif, elsif, elseif etc. in new languages.

doesn't check out:
--> src/main.rs:2:27 |2 | println!("Hello, {}", 2147483648i32); | ^^^^^^^^^^^^^ | = note: #[warn(overflowing_literals)] on by default
same code with a negative is accepted without warning, even though it must involve the same literal and an unary operation against it.

meanwhile, Forth, Lisp, and Erlang can all work with literals of arbitrary bases. Forth sets a variable that controls both input and output. Lisp has two variables for that. Erlang has a literal syntax that includes the base.

so what?
if you so desperately want to arbitrary bases integer literals write a macro.

OK you motherfucker. I'm drunk, but I'm not THAT drunk. What the fuck were you trying to say there? Do you even know how to speak English?

rust has macros to help dumbfucks like you make unmaintainable overly-clever shitcode.

Sounds like the bc calculator program. You can set ibase and obase. The value of literals in a function depends on the current values of these variables each time it is called, not when it is written.

So do Ada and Smalltalk. Ada has a base syntax for scientific notation too.

so what? so rust's documentation is bad. Just like the language. It makes an effort to say "oh yeah we don't have negative literals we're too neat for that" and this claim is immediately disproved when tested.

I only write JavaScript these days. Fuck you.

thank you for not writing typescript.

wtf? are you retarded?

inconsequential? it's a direct claim that the documentation went out of its way to make, and that it didn't have to speak on at all. The documentation also sucks when it does dining philosphers with only communists.

oh wow you are butthurt.
read this: internals.rust-lang.org/t/how-are-negative-int-float-literals-handled-during-lexing-parsing/3120/2

Oh. Actually...
I'm sorry, but the type system and cross-browser compatible transpiling is just SO convenient.

there's nothing to read there. Doesn't matter what the AST says if the language doesn't reflect that. Here's the timeline: rustfag links to rust docs, I look and see a claim and test it -- oh it's false. You can go through life demanding that people pile evidence on evidence before you'll believe that they're thieves, or sluts, or scammers -- I'll stick with the rest of humanity when I put extra emphasis on very easily obtained information. Someone says a vehicle is tough, the very first thing I do wrecks it, I don't need 99 more tests--I'm done.

here is why you are retarded: the rust documentation is correct.
now stop talking about stupid shit.

no, it's not. 2147483648i32 generates a warning. -2147483648i32 is accepted. The second is not treated as a negation of the first.

the fucking syntax you retard.
internals.rust-lang.org/t/how-are-negative-int-float-literals-handled-during-lexing-parsing/3120/2

your quote is the thing that my very simple example disproves. You're too to understand this -- no wonder you like Rust so much.

Or the compiler is clever enough to figure out that there's no real overflow problem.

internals.rust-lang.org/t/how-are-negative-int-float-literals-handled-during-lexing-parsing/3120/2

I have a PR that removes all the signs from the ast: github.com/rust-lang/rust/pull/3050818

In the AST a "literal" like -5 is actually ExprUnary(UnOp::Neg, LitInt(5, UnsuffixedIntLit(Plus))). After my change it will be ExprUnary(UnOp::Neg, LitInt(5, UnsuffixedIntLit)).

kys cia nigger

yeah, but this and higher-precedence operators are the only cases where you'd even notice the language not having negative literals. Yeah, it's probably just shitty writing and the only intent is to warn about exponential operators, if Rust even has those.

You're one of those halfwits who thinks that chairs being "really made out of atoms" means that chairs don't exist anymore, 'cause you can't sit on chairs -- you can only sit on atoms, tehepero. It doesn't matter what the AST looks like if the language's behavior doesn't reflect that.

fucking hell you are so retarded. negative integer literals are represented in the ast as a minus applied to an integer instead of a negative integer.

NO user YOU'RE FUCKING WRONG

Here's me writing documentation in your world: "Rust literals: they look like this, and this, and this. And oh yeah internally on 128-bit one's complement hardware we represent them in the AST literally as strings. But this has no bearing on the language's behavior at all, so it's pretty weird of me to mention this. Please forget it immediately. But remember: Rust is a serious language with serious documentation!"

just stop. nobody knows who you are. there is no shame in admitting that you are wrong.

[{"variant":"Integer","fields":["2147483648"]},"i32"]}]
oh shit can you submit a documentation patch? very important to point out that Rust's ints "are really" strings, because they are in the AST.

please tell me more about Rust's string-based integers. Was this a conscious imitation of Tcl?

You need to grow up, user.

The only thing related to growing up the internet can inflict upon me is an erection.

literally kill yourself you shitniggering piece of cuntsniffing fuck

>he's never seen monty python