[–]▶ No.1000440[Watch Thread][Show All Posts]
Legit rust thread, what are its pros and cons?
▶ No.1000448>>1000458 >>1000640 >>1000687
cons:
coc
cant get a job with it
meme lang
made by literal antifa members
worst performance then C
not compatible with pre-existing C++ libraries unlike D
good luck finding hardware support ie microcontrollers and other embedded systems, since you are forced to use their compilers.
pros:
if you want to be a hipster and know an obscure language and jerk off about it. Its the way to go.
▶ No.1000449>>1000463 >>1000691
Pro:
- forces you to write somewhat safe code
- software is fast
Con:
- steep learning curve
- some features missing, such as integer templating or function multiversioning
- limited to few architectures
- default package repository is hosted on github
- CoCed ecosystem
▶ No.1000450>>1000462
It's almost as ugly as C++. Which is kind of retarded for something made to replace it.
▶ No.1000458>>1000475 >>1000483 >>1000689
>>1000448
>cant get a job with it
I've literally been asked about my opinion about rust during a job interview. I have a strange feeling that if I told them I liked it I would have gotten the job.
▶ No.1000459>>1000689 >>1000707
Pro
- "zero cost" is the appropriate cost for lots of abstractions
- decently sized community and state of resources; the "too many lists" book is pretty good
- minimal runtime, makes it appropriate for sysadmin tasks where performance matters just enough that you can't use a scripting language
- cures cancer - safe memory management without a GC
Con
- the magic is inside a black box, and not your own: the borrow checker is a feature from on high that you negotiate with or re-utilize. It's arguable whether this is a con: when languages give you the magic, you also have to deal with idiots who misuse the magic in programs you come to maintain. But since Rust doesn't pretend to be a better-for-maintainers language, I think this limitation is one of the developers' imagination, rather than a limitation by design.
- the community is a obscene, writhing teratogen. "Dining with Communist Philosophers
these cons, plus more interesting languages Ada, ATS, Zig, is such that I haven't learned the language well enough to provide other cons. I thought rustfag did well with it in last year's advent of code.
▶ No.1000462
>>1000450
it's retarded if your goal is "a language prettier than C++"
if your problem with C++ is that it's too hard to understand, that it's too easy to write pessimal C++, Rust might seem a lot better. I've heard of cases where a print statement accidentally aliases a variable and slows Rust down by an absurd degree, though.
▶ No.1000463>>1000470 >>1000689 >>1018407
>>1000449
>- software is fast
faster than c++?
▶ No.1000470>>1000736 >>1000811 >>1000815
>>1000463
I don't know.
Also a neat feature that I forgot: it has .map() and ranges and Option monads, which C++ does not have.
▶ No.1000473
▶ No.1000475>>1000476 >>1000584
>>1000458
>someone asked their opinion of an obscure lang in an interview.
rust fags are just making up stuff now
▶ No.1000476>>1000561
>>1000475
Why would I make up a story about not getting a job? It was a faggot soy franshitsco company and were probably just asking to troll me anyway.
▶ No.1000483>>1000495 >>1003238
>>1000458
What was the job for? Communist book store clerk? Bathhouse towel boy? Antifa webmaster?
▶ No.1000495
>>1000483
I could tell you but you would have to abide by my Code of Conduct.
▶ No.1000561
>>1000476
How did you respond and did you reveal your autism?
▶ No.1000584
>>1000475
>Rust
>obscure
you are delusional
▶ No.1000640>>1000648
>>1000448
>made by literal antifa members
there is literally nothing wrong with antifa
▶ No.1000641
▶ No.1000648
>>1000640
nothing that death and then damnation won't cure, anyway.
or, in a sane country, the normal operation of justice.
▶ No.1000666>>1000667
I, Steve Klabnik, am here to answer all your (serious) questions about Rust.
▶ No.1000667>>1000696
>>1000666
Is Rust a Satanic agent?
▶ No.1000687>>1000707 >>1001014
>>1000448
>coc
How does it matter if you just use it?
>cant get a job with it
Extraordinary claims require extraordinary evidence.
>meme lang
This word combination doesn't have a meaning.
>made by literal antifa members
How does it matter? Are there any Hitler checks in the compiler or what?
>worst performance then C
Extraordinary claims require extraordinary evidence.
▶ No.1000689>>1000699 >>1000716
>>1000458
So what did you actually answer?
>>1000459
> I thought rustfag did well with it in last year's advent of code.
I remember. He suddenly disappeared when it was finally time to deal with tree-like data structures, for an unknown reason but you may guess why.
>where performance matters just enough that you can't use a scripting language
define "scripting language"
it's the implementation that decides performance
take a look at Cython or PyPy.
>safe memory management without a GC
>"zero cost" is the appropriate cost for lots of abstractions
Yeah these are the main points. Also it has rather good type system, clearly borrowing some good parts from Haskell.
>>1000463
for equal effort spent by the programmer, likely yes.
▶ No.1000691>>1000695
>>1000449
>forces you to write somewhat safe code
>pro
Forcing you to do anything is never a pro unless you're doing scriptkiddy shit.
▶ No.1000695>>1000703 >>1000828
>>1000691
so everyone who's not using assembler is a script kiddy, also anyone who cares about security and stability is also a script kiddy, got it.
even C forces you to respect type system somewhat, and to write code in more or less structural way
or if we get really pedantic then this
>>forces you to write somewhat safe code
is also not really true for Rust as you can ignore the rules where you want it, using 'unsafe' and then it doesn't really force anything anymore.
▶ No.1000696>>1000701
>>1000667
Yes. Rust is programmatic hedonism, C is self-discipline.
▶ No.1000699>>1000706
>>1000689
>define "scripting language"
a language where you write and run scripts. The most important part of that for system administration is that scripts are always deployed as source code, so when you need to look at them on a server you can always see, troubleshoot, and modify the source of the script at hand. You never need to, before you're even sure that this program is relevant to your problem, track down the thing's source (if it's even available)
there are corresponding negatives. Some jerk can modify a script and then you can come along and run it while thinking it's the usual version
but it's a very practical combination of features.
>implementation <> language
yeah, yeah. A lot of hacker rhetoric can be explained as the hacker not wanting to feel inferior to some other hacker. It's not that Bob over there gets to write serious shit in SeriousLang, it's that seriousness is a meaningless distinction and all languages are the same. conceptually. with a sufficiently advanced compiler.
At the end of the day that Python program you're writing is going to be executed 100% of the time by /usr/bin/python3 in various CentOS environments and therefore will spend two weeks searching various fatty crevices of the filesystem for libraries before it can print a simple "hello world", and if you don't want that kind of overhead your next best bet is usually C.
it's rare that languages really do blur this particular 'meaningless distinction'. I know because I was inspired by some Perl troubleshooting to go looking for any language+implementation like this. OCaml's one.
▶ No.1000701>>1000706
>>1000696
C is a verbose and restrictive BDSM language. Forth is self-discipline.
...
here's a language category for you: go fmt languages, that relieve the programmer of having to care about code formatting--his own or that of other people.
go is 100% such a language.
Python is a weak 30% go fmt language, only ensuring that your programs have some kind of indentation.
Ada is a strong 80% contender, only hampered by its huge list of style flags that can vary from repo to repo. also, technically, there are compilers other than gnat, which might not have a gnatpp
Common Lisp and Java are 50% go fmt languages: in practice, any serious person writing either is using an editor that does most of the formatting for the programmer. It's still possible to come across a rube writing Common Lisp in nano, who formats it like C, but at "50% go fmt" it's already acceptable to flame people like that.
▶ No.1000703>>1000706
>>1000695
>you can't have security or stability without Rust-tier high level cockbindings
Pajeet detected.
▶ No.1000704>>1000706 >>1000735 >>1004063
>doesn’t support compile time polymorphism, no compile time functions and expressions
>slower than C++
>no mature libraries
>borrow checker
>memory safety isn’t a problem in modern C++, making Rust useless
>too slow for realtime low latency applications
>will be abandoned in a few years just like D
▶ No.1000706>>1000709
>>1000703
History teached you nothing.
>>1000699
>a language where you write and run scripts.
Most languages allow that.
> there are corresponding negatives. Some jerk can modify a script
for a harmful dude, modifying a compiled blob is also doable.
>and if you don't want that kind of overhead your next best bet is usually C
there are better ways to solve that, when it actually becomes a problem.
first, Python files are translated to bytecode (which has minimal starting overhead to interpret) and you can choose to keep it. second, if you launch a process so fucking often, why not change the code in such a way that you will keep it alive instead. third, you can use OCaml, Zig, Rust, whatever else, C is really a last resort as you'll have to deal with UB left and right.
>>1000704
you're talking out of your ass
it has better compile time evaluation routines than C++ (which, it seems, is your ideal but is actually a pretty low bar)
next points are just lol
>>1000701
this is irrelevant as it's trivial to add a rule that any code is not accepted which doesn't pass automatic style check. and all mentioned languages have appropriate tools (except C perhaps, but I think it had some too)
▶ No.1000707>>1000713
>>1000459
>minimal runtime, makes it appropriate for sysadmin tasks where performance matters just enough that you can't use a scripting language
>Using Rust for sysadmin stuff
wtf?? If your scripting language doesn't offer enough performance, use luajit or similar.
>>1000687
>CoC is just positive thing!
>Antifa is our greatest ally!! Are you a Alt-Reich Nazi who voted for Trump or what!?
>POST PROOF!!!
>Stop giving criticism!!!!
>Don't invade my safe space!!!!!
>>>/oven/
▶ No.1000709
>>1000706
>you don't really need scripting languages, you could do other stuff instead :3
whatever dude. Every language mentioned in this thread is Turing complete. You bow to practicality in one area but not the other, probably because you have experience in one area but not the other.
▶ No.1000713
>>1000707
>2018
>unable to read
>>>/oven/
▶ No.1000716
>>1000689
>He suddenly disappeared when it was finally time to deal with tree-like data structures, for an unknown reason but you may guess why.
There was at least one other Rust fag except for me. I (Steve Klabnik) solved all the challenges. Check the archives.
▶ No.1000724
>Pros
If yuo never played it you're not a faggot
>Cons
You're a faggot
▶ No.1000735>>1018486
>>1000704
found the anti Rust shill
>doesn’t support compile time polymorphism
wrong: https://blog.rust-lang.org/2015/05/11/traits.html
>no compile time functions
RFC has been accepted: https://github.com/rust-lang/rust/issues/24111
>no compile time expressions
wrong: https://play.rust-lang.org/?gist=1e29419fe38b12055b9d992da85cd0e9
>slower than C++
wrong: https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/rust-gpp.html
>no mature libraries
not surprising considering that the language is pretty young
>borrow checker
not an argument
>memory safety isn’t a problem in modern C++
proof?
>too slow for realtime low latency applications
proof?
>will be abandoned in a few years just like D
D isn't abandoned though
▶ No.1000736>>1000778
>>1000470
>c++ does not have optionals
>c++ does not have map
>c++ does not have ranges
literally all of those are built into standard c++
▶ No.1000749
lmao the freeCOCS nigger is a rust shill. priceless
▶ No.1000778>>1000784
>>1000736
Post links to the documentation or show code samples, please.
▶ No.1000784>>1000787
▶ No.1000787>>1000789
▶ No.1000789>>1000801 >>1000805
>>1000787
>Not supported as of C++17
Ranges of the style `for (auto x : mylist) { ... }` have existed for years
>That's not .map()
Yeah IDK why he posted that. C++ has map it is just called:
http://www.cplusplus.com/reference/algorithm/for_each/
Everything in c++ is based on iterators so that you can do things like map over subsections, or map in reverse, etc.
>Nice. Didn't find that on cplusplus.com.
He did not link to the sub page it is here:
https://en.cppreference.com/w/cpp/utility/optional
But note that Boost has had optionals for years.
▶ No.1000801>>1000805 >>1000806
>>1000789
>http://www.cplusplus.com/reference/algorithm/for_each/
This isn't map though. Map lazily applies a function to every item of the iterator thus forming a new Iterator.
>https://en.cppreference.com/w/cpp/utility/optional
https://en.cppreference.com/w/cpp/utility/optional/operator*
>The behavior is undefined if *this does not contain a value.
LOL.
▶ No.1000805>>1000807 >>1000809
>>1000801
>This isn't map though. Map lazily applies a function to every item of the iterator thus forming a new Iterator.
>lazily
not necessarily
>iterator
map is a meaningful operation on non-iterable container types, such as optional.
>>1000789
That's not the kind of range that I meant. I was talking about what you'd get with range(1,10) in Python or (1..) in Rust or [1..] in Haskell. You can build those with generators, but those aren't there yet in C++.
▶ No.1000806>>1000809
>>1000801
Map being an iterator is an implementation detail. If you ask people in most languages for map, they'll show you a map that isn't one. If you port some code using map to most languages, you'll readily swap out the iterator for a non-iterator.
I take it Rust and JS are the only two languages you know?
▶ No.1000807>>1000816
>>1000805
>it's gotta be an OBJECT or an INFINITE LIST or something
no, what it's gotta do is take the common errors out of iteration, and C++ has done that for ages. Ada does it as well with 'First 'Last and 'Range attributes.
▶ No.1000809>>1000810
>>1000805
>not necessarily
We are talking about Rust's map. So yes.
>optional
Optional is a collection that can contain up to one element. Why shouldn't it be iterable?
>>1000806
We are talking about Rust's map.
>I take it Rust and JS are the only two languages you know?
I don't know JS. I know a couple of languages besides Rust.
▶ No.1000810>>1000811
>>1000809
No, we're talking about map. If you want to talk about "Rust's map", then never drop the "Rust's", because trivial shit like Rust's map being an iterator has nothing to do with maps. If someone handed you an iterator-based map or a range object in C++, you wouldn't even want it.
▶ No.1000811>>1000814
>>1000810
>No, we're talking about map
wrong: >>1000470
>Also a neat feature that I forgot: it has .map() and ranges and Option monads, which C++ does not have.
"it" as in Rust. It's fine to admit that C++ doesn't have an equivalent to Rust's map.
▶ No.1000814>>1000815
>>1000811
C++ does have an equivalent of Rust's map. It's for_each. It's what you reach for in C++ in cases where, in Rust, you'd reach for Rust's map. It's fine to admit that languages have features without obsessing about trivial shit. You didn't say "Also a neat thing about Rust is that its map is lazy."
▶ No.1000815>>1000818 >>1000847
>>1000814
>It's for_each
C++ for_each applies a function eagerly to every element of the iterator. It then returns the function. That is not an equivalent to Rust's map. It is basically Rust's for_each.
>You didn't say "Also a neat thing about Rust is that its map is lazy."
See >>1000470
>Also a neat feature that I forgot: it has .map() and ranges and Option monads, which C++ does not have.
"it" as in Rust. It's fine to admit that C++ doesn't have an equivalent to Rust's map.
▶ No.1000816
>>1000807
Generators aren't (necessarily) objects but coroutines, which again C++ doesn't support yet. And infinite ranges are useful.
▶ No.1000818>>1000821 >>1003114
>>1000815
<presents quote as evidence
>explains why quote isn't evidence
>hey you're wrong there bud, have you seen quote?
sorry, my brain is just too big for this small-brained argumentation. Most other language equivalents where you acknowledge the equivalency will still differ by small, perhaps interesting, but trivial details. If you translate 'good' from Chinese, you'll lose the detail that 'good' in Chinese is a pictograph of a woman holding a child. But you haven't (yet) failed the translation.
with Ada.Text_IO;
with Ada.Integer_Text_IO;
procedure Ranges is
package IO renames Ada.Text_IO;
package Int renames Ada.Integer_Text_IO;
Memes : array (1 .. 5) of Integer := (14, 42, 88, 666, 2014);
begin
for J in Memes'Range loop
Int.Put (Memes (J), Width => 4);
IO.New_Line;
end loop;
end Ranges;
man it's a real pity that Ada doesn't have ranges because "Python's ranges are generators". I had to double-check the logic in that loop, make sure I didn't have an off-by-one error. Range-less languages are scary.
there is now more Ada than Rust in this Rust thread
▶ No.1000821
▶ No.1000828>>1000829 >>1000831 >>1000834 >>1000837 >>1000843
>>1000695
>c forces you to respect the type system
C lets you cast from anything to anything, as it should.
>forces you to write structured code.
C has goto, as well as functions and structured loops and so on
What I don't get is this: c lets you write terrible code, but rust has a keyword to do the same thing. Hasn't anyone tried introducing a safe subset of c that could be statically analysed?
▶ No.1000829
▶ No.1000831
>>1000828
>Hasn't anyone tried introducing a safe subset of c that could be statically analysed?
Nobody would use it. After all C is already "perfect".
▶ No.1000834>>1000835
>>1000828
https://stackoverflow.com/questions/29951591/is-misra-c-applicable-to-linux-applications
so not unless you're working on embedded software.
for typical 'safer C' projects, the timeline is
1. let's make a safe subject of C!
2. oh shit. that means C with its arms and legs sawed off. Let's add some bionic limbs, to replace pointer arithmetic, etc.
3. oh damn, this is now a completely different language isn't it? Why would anyone even use this when there are already all these better-designed languages that are already safer than C?
▶ No.1000835
>>1000834
condensed timeline:
1. let's use C!
2. oh shit
3. oh damn
▶ No.1000837
>>1000828
There would probably be more work done on that if C/C++ had a sane module system where dependencies were compiled separately.
▶ No.1000843>>1000845
>>1000828
>C lets you cast from anything to anything, as it should.
No it doesn't. Perhaps your compiler does, but that'd be undefined behavior.
▶ No.1000845>>1000849
>>1000843
http://port70.net/~nsz/c/c99/n1256.html#6.3.2.3
>A pointer to void may be converted to or from a pointer to any incomplete or object type. A pointer to any incomplete or object type may be converted to a pointer to void and back again; the result shall compare equal to the original pointer.
▶ No.1000847
▶ No.1000849>>1000850 >>1000851
>>1000845
>from anything to anything
Can you safely cast from integers to pointers? Or from pointers to arrays of char?
▶ No.1000850>>1000853
>>1000849
>Can you safely cast from integers to pointers?
Yes
>Or from pointers to arrays of char?
I don't know. I'm not a C programmer. I linked you the specification.
▶ No.1000851
>>1000849
the worst-specified language has the most specification lawyers.
▶ No.1000853>>1000854 >>1002853
>>1000850
>>Can you safely cast from integers to pointers?
>Yes
Then what memory area does it point to? Sounds like this is not going to work on harvard architectures.
▶ No.1000854
>>1000853
>An integer may be converted to any pointer type. Except as previously specified, the result is implementation-defined, might not be correctly aligned, might not point to an entity of the referenced type, and might be a trap representation.
As I've already said, I'm not a C programmer. I'm done spoonfeeding you. Read the spec yourself.
▶ No.1001014
>>1000687
search performance benchmarks between C and Rust. maybe there is a few examples where rust pulls ahead slightly but for the majority of the time C rules nigger.
▶ No.1002647>>1002654 >>1002675 >>1002753 >>1019536
I want to like rust because i want a language that makes threading easy but
>that syntax
>the toxic community
fuck
▶ No.1002654>>1002700
>>1002647
Have you looked at Ada?
▶ No.1002675>>1002678
>>1002647
>muh syntax
LARPer spotted
▶ No.1002678>>1002681
>>1002675
I will never understand how complaining about syntax makes you a LARPer. A LARPer wouldn't give a shit about syntax because they never write anything anyways.
▶ No.1002681>>1002969
>>1002678
A programming language is a tool. It doesn't matter what it looks like, it matters how it performs. Only a LARPer would complain about how a tool looks.
▶ No.1002697>>1002700 >>1002760
Rust has a shiny new website at https://beta.rust-lang.org/. Can't screenshot because torfag.
▶ No.1002700
>>1002697
>exactly like every single other bootstrap website
shiny.
new.
>>1002654
Ada is readable and gnatpp solves formatting, but I can't type it the way they want it. I modified ada-mode in Emacs to autotranslate - to _ identifiers, so I'll enter
procedure what-the-fuck is
and Emacs'll show
procedure What_The_Fuck is
and then I gnatpp that later for horizontal alignment and spaces before parentheses and such.
▶ No.1002753>>1002761
>>1002647
Isn't that the main selling point of go? I'd actually love to get peoples opinion on that language over rust since at least to me it seems superior. Note I've only superficially looked into both. Pls no bully.
▶ No.1002760
>>1002697
rust succeeds at being so cancerous even at making its own website that the reddit response is generally good: https://www.reddit.com/r/programming/comments/a1jjyg/a_new_look_for_rustlangorg/
>Like I couldn't learn C or C++, because I'm not a smart enough programmer, and Rust comes to the rescue.
<Also, do the designers of this really know programming at all?
>These statements are neither false, nor useful. There isn't a programming language that discriminates.
klabnik:
>We also loved the idea of a code snippet, but couldn't find one that people actually liked,
THEY TOOK THEIR OWN LANGUAGE OFF THEIR OWN WEBSITE BECAUSE NOBODY LIKED IT
▶ No.1002761
>>1002753
meh, Go concurrency uses channels for intertask communication. It's the kind of system you get when your #1 goal is cheap parallelism and then you say, OK, how do I also use this for concurrent design?
Message-passing in Erlang (with receive) and Ada (with accept) is a lot nicer. I've heard that go's channels aren't that performant.
the main selling point of go is not having generics
▶ No.1002776>>1002779 >>1002881
Can someone tell me what big important projects they are working on that requires an entirely new language that cannot be addressed by the hundreds of thousands of libraries (many are duplicate objectives) available for C, C++, Java?
If there are faults/bugs in those libraries, why can't you as programmers go in and fix them without having to write an entire new language, a new compiler, bring people into adopt it, and then have them spend another decade or two writing the exact same libraries again?
How is that not backwards?
Why is that progress?
▶ No.1002779>>1002798
>>1002776
>There is absolutely no correlation between language design and the number of errors programmers make
▶ No.1002793
whatever happened to Adafag? was that just some LARPing? have you since switched to Rust?
me, I just reimplemented a raytracer that had a mutating dynamically-allocating C++ class: a vector of three floats, with math overloads. As I started out I kept griping about how I'd do it in Ada, particularly about how I'd manage memory and about Ada not having += operators.
I wound up with an immutable vector object in a 100% stack-allocating program. How the hell did that happen? The natural thing to do in C, if you want a function to return a new collection, is to allocate memory for it and return a pointer, and then document that the caller needs to free that memory. In Ada though, since procedures have 'out' parameters and since functions can return collections directly, what happens is that the caller's always responsible for memory. So the caller can just stack-allocate what you'd naturally heap-allocate in a callee in C. Of course it's also possible to do it the Ada way in C, and that's even common with syscalls (*stat(), getdents*()), but it's not natural so you see a lot more heap allocation.
▶ No.1002798>>1002808
>>1002779
Prove it instead of making bullshit statements.
▶ No.1002803>>1002805 >>1002822
Pros:
Linear Types
Cons:
Literally everything else
Just use idris with linear types so you can write your device drivers in an actual functional language without the garbage collection.
▶ No.1002805
>>1002803
>Just use idris
>without the garbage collection
You could use ATS, which is simple enough if you don't get more advanced than linear types, and which actually permits you to not use GC. Idris totally has a GC though, and it's in even more of an 'experimental' state than ATS (technically the author's fourth iteration on the idea); simple 30-line Idris programs can take 45 seconds to compile.
▶ No.1002808>>1002812
>>1002798
>Prove it instead of making bullshit statements.
<hurr durrr esolangs are as easy to write in as python
lol okay bud
▶ No.1002812
>>1002808
Why is /tech/ fucking dumb?
I know MIT is dumb fucks,
but /tech/? Pshh.
▶ No.1002822>>1002824
>>1002803
Rust has affine types, not linear types.
Iris does not have linear types either for that matter.
▶ No.1002824
>>1002822
Idris has Uniqueness types which are effectively the same thing.
▶ No.1002853>>1002893
>>1000853
The memory location "of the first char", if you converted for example 1 into a char *, it would point to the memory location 1. I'm 90% sure that's how it worked
▶ No.1002878>>1002883
sudo apt-get remove rust* libstd-rust* cargo*
sudo apt-get remove snapd* libsnapd*
▶ No.1002881>>1002974 >>1002975
>>1002776
There's many things you can't do no matter how many libraries you tack on because the language doesn't support the functionality required. For example there's no such thing as a dynamic array in C that you can use with array[i] syntax instead of some hideously convoluted mess of function calls and type casting.
▶ No.1002883
▶ No.1002893
▶ No.1002969>>1003052
>>1002681
so why don't you write directly in binary?
▶ No.1002974
>>1002881
I don't think that it's always important to have features like a dynamic array that's accessed with the array[i] syntax. I think it's fine to use a close enough feature like linked lists to group together a list of data.
▶ No.1002975>>1003052
▶ No.1003052>>1003074
>>1002969
>why use a lawn mower when you can use a knife
hmmmmm...
>>1002975
>vla = dynamic array
wrong
▶ No.1003074>>1003076
>>1003052
>It does not matter what a tool looks like
>But at the same time it matters what a tool looks like
▶ No.1003076>>1003096
>>1003074
>the only difference between a lawn mower and a knife is looks
▶ No.1003096>>1003097
>>1003076
Ah so language actually does matter and they really are different. Glad we agree now op.
▶ No.1003097>>1003098
>>1003096
I never stated otherwise. Also I'm not OP.
▶ No.1003098>>1003101
>>1003097
Then get out of my reply thread
▶ No.1003101>>1003126
>>1003098
How about you admit that you are a LARPer?
▶ No.1003103
▶ No.1003107>>1003111
>syntax doesnt matter
Then why isn't all software written in brainfuck?
HMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM?
▶ No.1003111
>>1003107
>muh brainfuck
please explain what is wrong with brqinfucks syntax. how would (You) improve it?
Protip: you're a LARPer
▶ No.1003114>>1003115 >>1003119
>>1000818
Could you contribute your inline codes at learnxinyminutes and share some of your cheat sheet syntax abaut ada programming. I just want to see what it can do without going through the shit load of books. Holy fuck, I've been waiting someone to post it for like, forever.
▶ No.1003115
▶ No.1003119
>>1003114
>There is only 4 commands, represented by next characters
>H: print "Hello, world!"
<Result:
< Hello world!
cancer.
▶ No.1003126>>1003128 >>1003135
>>1003101
Ah you are the faggot that replies LARP in every single thread. Well memed my reddit friend.
▶ No.1003128>>1003130
>>1003126
>Being this assblasted that nobody wants your ARM trash that you think its all one person
▶ No.1003130>>1003133
>>1003128
ARM? I have not said anything about ARM in this whole thread. You mixing me up with someone else? Nice.
▶ No.1003133>>1003137
>>1003130
Your asshurt posting style is very transparent and you are easily de-anonymized lad
▶ No.1003135>>1003137
>>1003126
The best memes are true memes.
▶ No.1003137>>1003143
>>1003135
>>1003133
>Responding to every post
▶ No.1003143>>1003148
>>1003137
>LARPing in every post
▶ No.1003148
>>1003143
>larp larp larp
*tips fedora*
▶ No.1003238
▶ No.1003540>>1004046
Pros:
Nothing that Ada and SPARK don't already cover.
Cons:
Made and evangelized by CoC sucking blue-hairs.
You're not a CoC sucker, are you OP?
▶ No.1004046
▶ No.1004063
>>1000704
D hasn't been abandoned lmao
▶ No.1005748>>1006291 >>1006292 >>1006299
>no exceptions
>panics instead of exceptions
>can't recover from OOM
I don't know how they can call themselves a systems or embedded language. It's basically Node.js for soyboys who couldn't hack C++.
▶ No.1005750>>1006377
PROs:
> open
> threading
> workflow
CONs:
> community
> reddit
> newness
▶ No.1006291
>>1005748
>>no exceptions
>>panics instead of exceptions
and?
>>can't recover from OOM
wrong
▶ No.1006292
>>1005748
Panicking is done on an unhandled error. As much as I dislike Rust, I have to say the way it handles "exceptions" is just perfect.
▶ No.1006299
▶ No.1006370
Literally all you retards have to do is fork it and use it without a CoC and develop a separate language that isn't influenced by CoC
It's a good language right now. If you're worried that CoC will poison it, fork it right now and CoC can't ruin your fork.
▶ No.1006377>>1006394
>>1005750
Community doesn't matter if you're just using the language rather than participating in its development. Code doesn't care about your politics.
▶ No.1006394
>>1006377
>it doesn't matter if other people are insane :)
this is an expression of hope, not of experience. In actual experience, insane people cause problems you don't expect, and very similar expressions of hope were made as communities were poisoned. Well the SanFran user group might be out but the cons are OK; well the cons are out but IRC is OK; well everything is out but at least I can use it; well trusting the official package manager is out but at least I can deploy binaries; well using the official binaries is out but at least I can still fork the code and remove the "anti-offensive-variable-names" shit; well ... but
▶ No.1011557
▶ No.1012053
▶ No.1012127>>1012462 >>1012467
Languages learned:
[x] dozens and dozens of shitty little languages due to ill-spent youth
[ ] Rust
[x] Ada (new)
Ada's not a meme. It's actually an amazing language. It has a low-level take on Erlang-style multitasking. It has ML-style datatypes and compiler warnings about missed cases (since 1983). You can pretty-print all of your code all the time and not worry about formatting disputes ala go fmt. You can point gcc at a C header and have it generate Ada bindings for you. You can alternately just 'extern a function' and say it's coming from C and then link the C object at build time. You can describe your project with Ada-like syntax and skip writing makefiles ala Zig. You can create objects that initialize themselves when declared, that correct themselves when assigned to, and that free themselves when they go out of scope. If you've ever read SQLite's take on assert() and how it's so important that go not having it completely defeats go as a serious language, Ada's pre/post conditions and type invariants are enormously better: you just put those in your specification and they apply wherever they need to, so your code is more reliably checked at no extra effort to you. In Ada it's much more natural and very easy to make the caller/a data structure responsible for memory, so lots of uses of malloc() just don't come up.
Ada's also readable. Really readable, if you follow conventions and pretty-print your code.
Most abstractions are about A) doing something tersely, but also B) doing something correctly and C) doing something telegraphically - a reader says "oh, you're doing X" just by looking at your code, without having to figure it out. An abstraction that lets you iterate over an object is about removing off-by-one errors and about not looking like other kinds of looping, as much as about making this common operation cute and small. In most modern languages though, cute and small is super important, to the point people would rather learn five different terse methods, than one more general but more verbose method. Consider iteration in Clojure (think about what precisely you're doing and then use the higher-order function for that exact thing) vs. Common Lisp (just use LOOP). And what this means is that changes to your cute and optimized code often requires massive rewrites rather than one-line additions. Simple shit like, "want to print out what you're looking at, 1/1000th of the time, for debugging?". In Ada this is just finding the spot and adding the debugging code. In lots of cute languages this is saying, "shit, I can't use this construct anymore"
Anyway what I'm saying with the last paragraph is that Ada is verbose. Actually I don't recommend writing Ada at all except with editor or custom keyboard layouts; no human should ever type Names_Like_This, hell I nearly got RSI from typing that just now. That style is super readable, but hack your editor so you don't have to type it, and then use pretty-printing to close the gap. I suspect that this is the actual, single reason why Ada isn't more popular, even though weirdly nobody talks about it. I imagine most people try Ada, immediately feel RSI pains, and then stop using it without attributing the pain to Ada, so they have to come up with some other justification to explain their own decision. "uh, Ada? uh it's old I guess. Not very modern. New languages do things better." Nah man, there are five Ada standards, and I've using planned Ada 2020 features already in some of my code.
It's also true that the Barnes book is horribly transphobic. My goodness.
Use Ada.
... unless a significant appeal of Rust to you is its error handling. Ada uses exceptions.
▶ No.1012462>>1012529 >>1012642
>>1012127
>shilling ada in a rust thread
DESPERATE
E
S
P
E
R
A
T
E
protip: the first paragraph also applies to rust.
protip2: you can make something exception-like in rust.
▶ No.1012467>>1012475 >>1012529 >>1012576
>>1012127
I really want to try Ada, but
>made by a Jew
>made specifically for ZOG military
>absolutely dead in the water besides niche uses
Got something similar that isn't the things listed above?
▶ No.1012475>>1012485
▶ No.1012485>>1012488 >>1012529
>>1012475
ATS has a worse syntax than Rust.
▶ No.1012488>>1012493
>>1012485
>muh syntax
LARPer
▶ No.1012493
>>1012488
Good job trying to read code you can't understand, kike.
▶ No.1012529>>1012565 >>1012640
>>1012462
>look a this loser doing the thing that's always done in Rust threads
If I ever buy a Rust book and the preface doesn't mention Ada, I'm going to write a negative review.
>thinking that "Ada uses exceptions" means "hey, Rust should have exceptions"
this is what real shilling looks like. You just scan for adversarial-looking speech so you can rush in and defeat it. But you don't get paid to read at all carefully.
>>1012467
>Jew
I knew it: Words_Like_This is a Jewish trick to induce RSI in white men. Too bad for Jews: that's more readable and smart editors exist.
>for ZOG military
Go be a hippie somewhere else
>absolutely dead
it's literally better, right now, than the language you're using, for the task for which you've chosen your language.
It's like you're about to eat cereal, and then someone bursts in to tell you that stock price just dropped for that brand of cereal. This changes nothing about what the cereal's going to do the same thing to your body after you ingest it. Continue eating.
And, by ignoring the 'problem' you can fix the 'problem'.
I'm aware that this can be said of all unpopular languages, but most languages suck, including the unpopular ones. Ada's actually good.
>>1012485
Funny thing, Ada's various forms of declare ... begin ... end are identical to ATS's let ... in ... end. I haven't seen something like this in any other language. Probably a Pascal thing. I never learned any of those shitty academic languages...
▶ No.1012565>>1012578
>>1012529
One, you're retarded for comparing a consumable product with a tool that is dependent on updates, bug fixes, and libraries. Two, you're a painfully obvious shill.
▶ No.1012574
C and C++ made a lot of good assumptions and programmers liked it general, it solved a lot of issues for people
While Rust is trying to do something similar, its assumptions are based on what "nu-programmers" and amateurs are doing, its not helping to solve anything
A lot of this has been solved in many different ones in different way, Rust solutions are controversial and not robust enough to withstand any pressure from people in the community, and apparently ignoring most of the criticism isnt going to help
▶ No.1012576
▶ No.1012578
>>1012565
>updates, bug fixes, and libraries
Yeah but, Ada's not dead. It's commercially supported and has people paying for these things. Rust's community is cancerous and its commercial support is weaker.
You get more libraries from the cancer, this is true. And if you bite that hook too hard you'll be writing all your code in Python.
>painfully obvious
The sun declares that it's painfully obvious that the moon has some secret fusion reactor research going on. Just look, dudes, it's already emitting light from all the fusion it's doing!
▶ No.1012640>>1012642
>>1012529
>>thinking that "Ada uses exceptions" means "hey, Rust should have exceptions"
Alright now it's clear why you are shilling Ada in a Rust thread. You can't read.
▶ No.1012642>>1012648
>>1012640
yeah, BS. There's no other way to read >>1012462 than an attempt to defend Rust from an attack. "You want exceptions? uh, uh, you can have them! Rust plus exceptions is totally a realistic option my dude! Everybody who thinks that exceptions are important and should be in a language, be at ease."
a non-shill would just say that Rust has its own error handling and you should use that instead, without sweating that somebody somewhere might give Rust a pass for this reason.
▶ No.1012648>>1012651
>>1012642
>incoherent rambling
The Ada weenie is mad that Rust is so flexible enough (unline Ada), you can do error handling in multiple ways.
▶ No.1012651>>1012655
>>1012648
>incoherent
illiterate.
>Rust can handle errors in multiple ways, unlike Ada
stupid.
▶ No.1012655>>1012658
>>1012651
The butthurt Ada weebie is about to cry
▶ No.1012658>>1012663
>>1012655
troll_weeping_while_claiming_to_drink_tears.tiff
▶ No.1012663>>1012664 >>1012717
>>1012658
>the language i've been shilling my whole life for was superseded by Rust
▶ No.1012664>>1012665
>>1012663
literally learned it in the last month due to people talking about it in shitty Rust threads like this one :)
▶ No.1012665
▶ No.1012717>>1012746 >>1018460
>>1012663
>not even attempting to remove the watermark
▶ No.1012746>>1012747 >>1018485
>>1012717
>not adding your own watermark
▶ No.1012747
▶ No.1018407
>>1000463
obvs depends on the program and compiler but it's not unreasonable to say rust is faster
https://benchmarksgame-team.pages.debian.net/benchmarksgame/faster/rust.html
▶ No.1018460
>>1012717
LOL YOU ARE SO ANGRY??
BUT LIKE IT DOESNT EVEN MATTER SO??
NOBODY CARES ABOUT WATERMARKS ON THERE PIC??
LMAO👏BYE👏SWEETIE??
▶ No.1018485
>>1012746
jokes on your faggot I already lost it yesterday
▶ No.1018486
>>1000735
nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger nigger
▶ No.1019536>>1019584 >>1019586
>>1002647
>the toxic community
ya that's how I feel about chan culture in general.
and why I usually haven't posted here, even when searches bring it to my attention.. I avoided 4chan despite friends talking about it for years.. it's much more serene to walk away than argue with a troll.. but now am realizing, that if I leave the shitposters to continue unchecked, they will actually ruin society. their 'niggerfaggot' shit is spreading beyond the chans, which I hoped would function as a containment /quarantine zone.
▶ No.1019540>>1019583
▶ No.1019583
▶ No.1019584>>1019589
>>1019536
kys, nigger. i bet you glow in the dark.
▶ No.1019586>>1019589
>>1019536
>fails reading comprehension to social signal about internet culture
who let you out of the cuckshed?
▶ No.1019589
▶ No.1019617>>1019674 >>1019776
Why does `if` needs braces even if there's only one statement? In C, it's logic at least: `if` takes one statement and the curly braces pair is the grouping and scoping operator.
Languages mixing syntax and style are cancerous.
▶ No.1019674>>1019745
>>1019617
>waah it's not exactly the same as c
▶ No.1019745>>1019776 >>1019865
>>1019674
The question is: why the curly braces? What do they do? By the way, I'm not biting, just waiting for someone dumb enough to really defend this shit.
▶ No.1019776>>1019828
>>1019617
>Why does `if` needs braces even if there's only one statement?
https://www.imperialviolet.org/2014/02/22/applebug.html
>Languages mixing syntax and style are cancerous.
You just BTFO yourself.
>>1019745
>What do they do?
Letting me put whatever whitespace wherever I please.
▶ No.1019828>>1020062
>>1019776
Every nigger using this Apple bug as an excuse for reducing readability should kill itself.
>>Languages mixing syntax and style are cancerous.
>You just BTFO yourself.
How? Rust forces users to use their "righteous" style without any syntax reasons, C doesn't. It's the new fashion: languages telling you to choose between spaces and tabs and how many spaces to use and other bullshit.
▶ No.1019865>>1020066
>>1019745
Rust lets you elide the parens in the conditional expression, so you need the curlys of the block statement to act as a separator.
▶ No.1020062
>>1019828
I'm not even sure what you are trying to say at this point.
Anyways you have exposed yourself as a LARPer when you said that significant whitespace is new.
▶ No.1020066
>>1019865
It is the other way around. Requiring curly braces even for single statement if expression was a conscious design decision.
▶ No.1023828>>1023855
>Coincidentally, I just started writing some rust... I find this sentiment strange; people don’t look to other languages because you can’t do something in c++, but more often because you can.
John Carmack
https://twitter.com/ID_AA_Carmack/status/1089286703817412608
▶ No.1023855>>1023858
>>1023828
Nobody is saying that Rust isn't better than C++. But that's not a very flattering qualification.
▶ No.1023858>>1023874
▶ No.1023874
>>1023858
counter countersage
▶ No.1025400>>1025401
There is a program I am interested in being developed (Fractal client for Matrix). It's programmed in Rust.
As an end-user rather than a developer, what will be the pros and cons? (eg. much faster that JS shit? Less memory exploits?)
▶ No.1025401
>>1025400
>As an end-user rather than a developer, what will be the pros and cons?
None