[–]▶ No.1062254[Last 50 Posts]>>1062285 >>1062291 >>1062510 >>1062548 >>1062569 >>1062976 >>1063175 >>1063405 >>1072624 >>1073566 >>1073584 >>1076100 [Watch Thread][Show All Posts]
Learning a language edition. Let's talk about our troubles and successes.
____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062285 >>1062328 >>1062418 >>1071947
>>1062254 (OP)
I couldn't get passed the borrow checker while trying to write a doubly-linked list in Rust. This is how I'm a brainlet and the Rust language is too smart for people like me.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062291 >>1062294
>>1062254 (OP)
write better op
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062294 >>1062404
>>1062291
What's wrong with it?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062328 >>1062512
>>1062285
Rust is so good they fired their shills.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062369
I want to learn C because Dennis Ritchie invented programming.
I can’t even imagine that I would get a job if there would be no UNIX, no Linux, no Windows, no graphical application, no sound driver, no GUI based tools, no programming languages and still we would be struggling with binary and machine level language. There would not be computerized electronic gadgets no iPhone, iPad etc.
http://www.aliencoders.org/content/person-who-founded-c-and-unix-dennis-ritchie-no-more/
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062404 >>1062733
>>1062294
Everything. If you want to start a discussion you have to start it yourself, not just make a thread and tell people what to discuss. This is not a homework assignment for us.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062415 >>1062458
I've rarely used C++ since college, but I'm starting the EOS.IO developer courses soon and will have to dust it off. Not rly looking forward to it, tbqh
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062418 >>1062455 >>1063508
>>1062285
struct Node<T> {
prev: *mut Node<T>,
next: *mut Node<T>,
value: T
}
Wow. So hard.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062447 >>1062453 >>1062607 >>1062637 >>1062936 >>1069680
>||
How do you produce these bad boys with the keyboard in pic related? The symbols on the keys in blue look like them, but shift and alt/alt gr don't do the trick.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062453 >>1062641
>>1062447
You use english US layout in software. You do know how to touch type, right anon?
I actually use a keyboard with german layout at work, even though I never use that layout. It was the best keyboard there, but nobody used it, probably because nobody here even speaks german.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062455 >>1062467
>>1062418
>not knowing that the hard part is writing the allocation functions.
https://rust-unofficial.github.io/too-many-lists/first-push.html
Baiting aside, I don't get why a linked list has to be so contrived. The guy's introducing functions (mem::replace) that you don't even hear of in the "nice" tutorials that don't go over linked lists. What the fuck is your language if you can't even give me a clear set of primitives with which I can accomplish all I need? Either the language is incredibly stupid, or I am for not "grokking" it. And I'm too autistic to tell the difference with certainty.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062458 >>1062497
>>1062415
>open eos.io
>first word i see is blockchain
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062467 >>1062488 >>1071466
>>1062455
>>not knowing that the hard part is writing the allocation functions.
Nigger, linked lists aren't hard. You learn how to do those in your first semester at university. After that you never use them again because they suck.
>The guy's introducing functions (mem::replace) that you don't even hear of in the "nice" tutorials that don't go over linked lists.
What the fuck are you even trying to say?
>What the fuck is your language if you can't even give me a clear set of primitives with which I can accomplish all I need?
?????????????????
Your image is an accurate depiction of yourself.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062478 >>1062479 >>1062741 >>1063164
Is there any inherent performance difference between calbacks and promises in node.js?
const fs = require('fs-extra')
// Async with promises:
fs.copy('/tmp/myfile', '/tmp/mynewfile')
.then(() => console.log('success!'))
.catch(err => console.error(err))
// Async with callbacks:
fs.copy('/tmp/myfile', '/tmp/mynewfile', err => {
if (err) return console.error(err)
console.log('success!')
})
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062479
>>1062478
>node.js
No difference. Both perform like shit.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062488 >>1062489
>>1062467
Read the post nigger. I've written (both simply and doubly)linked lists about 100 times in C and C++. What I couldn't manage to do is write one in Rust without triggering the borrow checker.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062489
>>1062488
You literally posted a link to a tutorial on how to write linked lists in Rust.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062497
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062510 >>1062706
>>1062254 (OP)
Why are you having issues learning a programming language? Learning languages is the easiest part of software development.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062512 >>1062532 >>1062549 >>1062783
>>1062328
Why is Rust such an unpopular general-purpose programming language?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062532 >>1062567
>>1062512
Rust wants to steal both the memory safety crowd and C++ programmers, but they think pandering to C++ fags lets them get away with a messy language and awful compile times. This disgusts memorysafety fags and C++ fags aren't interested in another fat language with glacial compilation, so Rust is stuck with a small but very loud group with much lower standards: hipster webdevs.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062548
>>1062254 (OP)
>end up in Data Science
>it's a thankless meme job where you get shit on by everyone in the company who are desperate to poke holes in your analysis
>all I want to do is program all day and not worry about company politics
Is such a thing possible bois
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062549 >>1062567
>>1062512
I genuinely don't know
Go seems to be everywhere all of a sudden but I much prefer Rust
I think it still has the reputation of "don't use this, it's not mature enough" even though it's probably fine
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062567 >>1062732 >>1067095
>>1062532
The majority of users are diversity hires and third world labor, that's who it was designed for, real programmers don't need the language to hold your hand to the extent that Rust does.
>>1062549
Maturity has nothing to do with why you shouldn't use Rust.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062569
>>1062254 (OP)
Every fucking time i tried to learn android i would stop at Fragments. Good thing they removed it in the Android 9 update.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062597
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062607 >>1062641
>>1062447
Try different combinations of Shift, Fn and Alt Gr. That's probably the solution, but I don't know for sure.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062637 >>1062641
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062641 >>1063122
>>1062453
>>1062607
>>1062637
It's alt gr plus the < key. Figured it out a while ago.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062706 >>1062732 >>1066066
>>1062510
Besides mastering a language and learning some stuff about networks and databases, what else is there to software development? Problems become solvable when you know what you're doing.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062732 >>1062773
>>1062706
Learn how to sleep at your desk. Learn how to spend 6 months writings a minimal CRUD app in PHP. Collect a fat check and produce little to no value. Outsource 95% of the job to consultants for 5-10x reasonable development costs. Use JQuery UI in 2019 for your SPA.
That's been my experience with software "engineers"
>>1062567
Learn Perl6. Trust me.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062733
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062740 >>1062773
>starting to realize that objects are just structs with functions attached and the ability to make retard children with
fug
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062741
>>1062478
It's most likely more dependant I the specific callback/promise than is measurable objectively. I imagine in the post you made it'd be negligible, no?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062773
>>1062740
>he didn't read SICP
oh anon I am disappoint
>>1062732
>Trust me
I'll do it!
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062783 >>1062802
>>1062512
> Crystal
Now do Nim, you fag.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062802 >>1062887 >>1071447
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062887
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062936
>>1062447
Those ISO keyboards/keyboard layouts are an abomination. Just get an ANSI (US) physical layout keyboard, and use a "US-International" logical layout if you need regional characters.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1062976
>>1062254 (OP) (OP)
>on your own, learning to code and coding a game engine and your game in a couple of months
Nene's a clever girl.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063122
>>1062641
Shit.
Don't know why I said shift instead of alt.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063164 >>1063171 >>1067095
>>1062478
How do you put your code in a fancy window like that?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063171 >>1063379 >>1067095
>>1063164
Press Alt+F4 to open a secret 8chan text editor.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063175 >>1063176 >>1075253
>>1062254 (OP)
BASIC was the first language I learned. I learned that from a tutorial series on YouTube. It's an easy language but there are ton of different version of BASIC all with slightly different syntaxes. So looking up code examples I was often finding it hard to get things to work and not understanding why it didn't work when I followed tutorial to a t.
Visual BASIC 2010. Since I had a handle on QB64 I figured I was jump in to VB. It was easy to pick up and as long as I was looking for VB2010 tutorials or code examples I was doing fine.
Gets interesting. I switched to Linux and back then there wasn't much support for BASIC. So I learned C++. C++ is great for creating fast fast binaries but getting libraries to work always seemed to be a pain in the ass and I wanted to learn network programming.
Started learning Java. Did several series of tutorials on Java. Progammed in Java for a while. Got further into networking and got into security. Started learning to hack. Started working with penetration testing tools. Most of them were written in C. So I started learning C. Fucking hated it. Learned enough to look over a program and see how it worked. Other than that fuck it.
Picked up a Ruby book and learned Ruby. Never used it again after that.
Had a friend who was working on cryptocurrency project. Customized a wallet for him based on the world coin wallet. C++/Qt already knew C++. Crash course in Qt/QML made wallet look fucking cash. Have forgotten everything I learned about Qt/QML since then. Never used it ever again.
Had a friend who suggested I learn C#. Downloaded C# books and started trying to learn C#. Could never find a tutorial where the code actually worked. Didn't want to fuck with shit I didn't understand Fuck C#.
Wanted to learn MySQL. Decided the manual was 5000 pages of bullshit and the syntax changes for nearly every major version you have to look things up but you always find an answer that is different syntax than the version you are using. Fucking gave and used flat files.
Learned some PHP and PHP/MySQL applications development because I wanted to build my own search engine. PHP as a language sucks donkeyballs and I've already mentioned PHP sucks. If it install from CentOS and Cpanel or there's an install script that does everything unattended I'll use it. Otherwise it's static HTML or just enough PHP to include headers, footers, navbars, etc so I don't have to repeat code and I can just template pages with some includes.
Javascript. Wrote some shit in Javascript. It's an easy language to learn. It's C like in many regards but more like C++ and Java rather actual C. So the syntax is easy to pick up if you've learned a C like language in the past.
Kept coding in C++ for a long time. Realized I could just use system calls to do a lot of shit. Realized I don't really need C++ when I have a lot of Linux tools that will do exactly what I'm trying to do with C++. Learn BASH scripting and get good it. Coding in BASH a lot.
Friends start sending my python scripts. Look at this. I'm like dude, I'll get around to learning python later. Once you have time invested in learning something and getting good at it you just want to work in that language because it's just more efficient. But I eventually got a python book and learned python. Started using python more and more. Use it a lot now.
Wanted to learn real hacking and maybe earn cash on bug bounties rather than working for the man. I picked up some books on X86_64 and started learning assembly. Did some crash courses in bug hunting, exploit development, and writing shellcode. Low level programming is alright and I'm sure I could have got good at it if I would have spent the time. It takes time to learn. You're not going to learn assembly overnight. It takes time. Must leverage time effectively.
Since most of the programs I write about 100 lines of code and I don't care about optimizations I try to use scripting languages as much as I can. Python or shell scripting is really where it's at for me.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063176
>>1063175
Regex really comes in handy but it's basically a language of it's own. But grep and python's re are pretty fucking useful if you want to sort a larger data set for just a few statements like a phone number, email address, or IP. I would suggest learning it or at least have some idea what it can do and have a cheat sheet. It will come in handy at some point.
Once you know one language it's easy to learn another and if you know programming in general it's easy to write a program in a language you don't even know just by looking each thing up on a search engine as you go like how do I declare a variable in X, array in X, print statement in X, system call in X, and that makes it easier to understand how other people's programs work.
I had thought about learning go or rust at some point just because people are always saying learn X but really who has time for all of that. I don't code for a living and I wouldn't want to work for someone else just because I tend to get really pissed when I can't figure things out and make something behave the way I want so I would probably have a cussing fit at the office and fired my first day.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063379 >>1063399
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063399
>>1063379
>captcha get's installed
>place immediately turns into /g/
lmfao
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063405 >>1063406 >>1064227
>>1062254 (OP)
I'm working on a big open source C project and the garbage collector written by another guy makes no fucking sense and has little documentation and I have no idea how to use it. There are some subtleties with freeing objects that are somehow shared confusing the fuck out of me, and though I have some experience with manual memory management this is a new confusing hell for me.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063406 >>1063409
>>1063405
Manual memory management isn't hard, chances are it's even harder to use whatever garbage collector you're using and it comes with a performance penalty as a reward too.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063409 >>1070578
>>1063406
Objects are registered with GC at creation and just freeing them at the appropriate time causes segmentation faults. I guess I will have to make all new allocation and free methods for the objects I am using to avoid this headache
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063508 >>1063524 >>1063828
>>1062418
That syntax is worse than vomit.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063524
>>1063508
That's just like you own opinion fam
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063550 >>1063553
Hi, I've recently started learning Guile scheme.
Things I know already are basic data types, conditionals, procedures and simple I/O from and to console, creating and reading a file.
Is there something cool I can do on this level to test myself? A certain kind of game, program? My mind is so empty.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063551
>actually did tcp right this whole time
>just clear the string before i sent it to the serber
fug my shit up
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063553 >>1063554
>>1063550
Learn how to integrate Guile into a C program.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063554 >>1063958
>>1063553
>Learn how to integrate Guile into a C program.
There is a tiny problem, I can't C yet. Tried a bit C++, but guess it's not the same. I'm looking for a scheme-only task.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063821 >>1063828 >>1067095
How much of the specialized lessons can you ignore and still be a well-rounded java programmer?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063828 >>1063831 >>1063863 >>1064227
>>1063508
>muh syntax
Anti Rust shills always resort to this because they don't actually know enough about Rust to post legit criticism.
pathetic
>>1063821
Skip everything except Generics and then look at popular Java libraries.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063831
>>1063828
>skip everything except generics
Even the security and network stuff?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063863 >>1063880 >>1063896 >>1063928
>>1063828
There's no such thing as an anti-Rust shill. Nobody would give a fuck about that abomination if Steve Klabnik didn't brigade
Every HN thread where Rust is ever mentioned
Check Zeming Yu's paper on Rust on arxiv. Rust's safety is a lie. You're only safe from memory bugs in trivial use cases that could have been discovered with a decent static analysis tool. Or you could use a GC language because 95% of use cases don't actually need that small performance boost of manual memory management (and borrow checker and lifetime annotations literally everywhere is not actually less work than manual memory management).
Ask yourself, why are there NO large scale Rust projects on GitHub? Redox is a failure. Nobody uses Servo. Firecracker VM is riding on Amazon's name. Rocket is full of retarded emojis and is less performant than Node and Go. The stars of the Rust world are rewrites of GNU coreutils. Fucking wow. Grep was really holding me back until now.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063880
>>1063863
Oh, there are large scale Rust projects out there, they're still compiling.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063896 >>1063899 >>1063900
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063899 >>1063928
>>1063896
Nobody is actually shipping actix. Have you tried to write any non-trivial application? No? Here's a preview: Imagine your helloworld server had 80+ dependencies and takes more than 10 minutes to compile on retail hardware.
>Oh but Lemmy uses actix!
The federated reddit that has yet to implement federation does use actix. So we have one vaporware application where some huehue copied an AngularJS shitshow and used bots to upvote himself.
Cloud Hypervisor is an experiment with its first commit just this month. Give it a couple years. It will be abandoned. You might notice Nemu is written in C.
Remember Iron, Nickel, and Gotham? Remember how they were going to be the hotness in web frameworks with impeccable safety and concurrency? Weird how those projects all seemed to start fast and then fizzle within 18-36 months. Why is that? Could it possibly be that Rust is a fucking trainwreck of a language where literal homosexuals just wrote every feature they thought was "cool" on a white board and then proceeded to haphazardly "stabilize" these features into their language. All the mistakes of design by committee are personified in the Rust language. It is a cautionary tale of letting hipsters be in charge of anything at all.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063900 >>1063928
>>1063896
>a web framework
>two VMMs
>(((Intel)))'s VMM is in a very early state and relies on someone else's VMM crates to do the heavy lifting
Wow, you sure showed everyone.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063928
>>1063863
>There's no such thing as an anti-Rust shill.
LMAO
>Check Zeming Yu's paper on Rust on arxiv.
Link pls. Better yet: uploaf PDF here
>Ask yourself, why are there NO large scale Rust projects on GitHub?
Except for those you mentioned right after that sentence?
LMAO. That absolute state of anti Rust shills.
>>1063899
Did Steve Klabnik rape your mother? Calm down, nigger.
>>1063900
Dropbox and Cuckflare are also using Rust in production.
Kys, LARPer.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063951
Hello. Newfag here. I also dont know shit about programming or technology and i have been interested in programming languages for audio/music production
I have been questioning if i should learn Pure/Purr Data or SuperCollider
btw i use Windows lol
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063958 >>1063967 >>1064539
>>1063554
Not learning C (or at least the C subset of C++) and skipping directly to a high level-language can lead to bad programing habits. C beats into you how the machine works, so even when you learn to use high-level abstractions and languages you won't abuse them to write bloated inefficient code. So be careful .
> I'm looking for a scheme-only task.
Here's a fun one:
Write a symbolic derivatior for dx:
Eg: you give it a string "x^3+y*x" it should give you something along the lines of "3*x^2 + y" .
If you know the language well it shouldn't take more than a day.
Here's an outline of how to do it:
First you transform the string into a flat symbol-list, (x ^ 3 + y * x) then into a scheme-like expression-list-tree (+ (^ x 3) (* y x)) (trough parsing), then apply the derivation rules, then simplify maybe, then transform it back into a string
https://en.wikipedia.org/wiki/Differentiation_rules#Elementary_rules_of_differentiation
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063959
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063961 >>1063965 >>1064051 >>1067095
I work in Java right now. Tired of NullPointerExceptions and the pain of checked exceptions, I suggested we move a bunch of our code to Kotlin, which was approved by the project lead. Learned a bunch of Kotlin, worked through the Koans, and built some sample stuff, and then actually moved a bunch of our code to Kotlin. Things were cleaner and more succinct, I was able to eliminate tons of the null checks. We were using lambdas everywhere, which with checked exceptions looks a lot like this:
try {
try {
optional.ifPresent((Type item) -> {
try {
// This throws a checked exception
item.doSomething();
}
catch (CheckedException e) {
throw new RuntimeException(e);
}
}
}
catch (RuntimeException e) {
if (e.getCause() instanceof CheckedException) {
throw e.getCause()
}
}
}
catch (CheckedException e) {
}
Thanks to no exception checking, Kotlin makes it look something like this:
try {
optional.ifPresent { item ->
item.doSomething()
}
}
catch (e: CheckedException) {
throw e.getCause()
}
Our code was way nicer, way safer, and easier to maintain.
The Project Manager (over the Project Lead's head) denied the merge because nobody in the company knows Kotlin except me. I insisted that our Java developers could easily learn Kotlin in a day or two, but he mumbled something about maintainability and went back to his office.
Fucking shit working on a team sucks sometimes.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063965 >>1064051
>>1063961
Doublepost. Just to add, Java's checked exceptions are fucking garbage. On their own, they are an okay feature that force more safety, but Oracle fucked up the design by making them completely not fucking work with lambdas, and by not properly extending types like Runnable to throw Exception (or at least fucking giving a CheckedRunnable type or something for backwards compatibility), making you have to wrap all your fucking checked exceptions in tons of goddamn cases and unwrap them on the outside. All types being nullable by default is also shit.
Working with Java for the past year. It's better than Python or Ruby, but I'll take any fucking language with non-nullable types if I can get it. Even Rust. I actually quite like Rust, and a lot of the nicer bits of Kotlin resemble Rust quite a lot.
Java is the only goddamn language I've seen that makes Lambdas more painful to use than just creating a goddamn callable class.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063967 >>1064046
>>1063958
>Not learning C (or at least the C subset of C++) and skipping directly to a high level-language can lead to bad programing habits. C beats into you how the machine works, so even when you learn to use high-level abstractions and languages you won't abuse them to write bloated inefficient code. So be careful .
Don't worry I've learned C++ enough and I'm not all green about computers. I'm learning scheme, because Guix System uses it and because of my autism - I was tired of C-like syntax.
>Write a symbolic derivatior for dx
Sounds cool, will check it out, thanks. Maybe I'll post the code.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1063968 >>1064161
i see a single design flaw and i declare the entire language shit so i cant learn it.
AndWhatTheFuckIsThisC#();
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064046 >>1064539
>>1063967
>Sounds cool, will check it out, thanks. Maybe I'll post the code.
Parsing infix notation is really the hardest part. If you need a tip, here is an algorithm that can do it: shunting-yard algorithm
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064051 >>1064052
>>1063965
>>1063961
Been writing Java for over 10 years and whole-heartedly agree. I was so excited when Java 8 came out, only to be disappointed when I ran into what you're describing (as well as the insanely convoluted stack trace). I simply don't use checked exceptions for my custom exceptions these days. It's a shame your company won't move to Kotlin; it's such a better language. Almost all Kotlin jobs are Android development (bleh).
Since you're stuck with Java, you could create some utility interfaces to abstract away the re-throw, as described here: https://dzone.com/articles/how-to-handle-checked-exception-in-lambda-expressi
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064052 >>1064053
>>1064051
>muh exceptions
Just don't write code that fails. What's so hard about that?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064053 >>1064078 >>1064147
>>1064052
This, if you write code that has errors or bugs then you're literally no better than niggercattle.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064078 >>1064147
>>1064053
>no-coding this hard
You are unworthy to quote St. Terry
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064147
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064161 >>1064215 >>1064297
>>1063968
The only language I like and I'm comfortable with is Lua. The problem is, it doesn't have the kind of community and support other languages have. I sometimes actually have to read documentation and figure out my own solutions. Of course there's probably no employer looking for a Lua programmer either.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064215 >>1064225
>>1064161
>Lua
Just curious, how did it come to be that you only use Lua? I see it used as a supplementary language paired with something else, so I find it odd.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064225
>>1064215
I wanted to make games, so I started with pygame since everywhere you look people recommend python to inexperienced programmers, but I didn't like it. I didn't care for the space-sensitive syntax, and there seemed to be this tug-o-war going on between python2 and python3. I ended up using Love2D after looking for an alternative and I just found Lua easy to work with.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064227 >>1064228 >>1064229 >>1064272 >>1064295 >>1065121
>>1063405
Read M Timm Jones's books on Linux development. Shit will make more sense.
>>1063828
Is there a fun programming book to learn Rust? Like hacking with Rust or game programming with Rust or just sick and tired or boring dry programming books. I've read hundreds of thousands of programming books. You know what they need? Fucking dank Pepe memes and shit that makes you laugh. And autism jokes.
/tech/ we should start a b& and do some open source collaborations. It could be fun.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064228
>>1064227
Sorry meant to say hundreds of thousands of pages.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064229 >>1064251 >>1066013
>>1064227
>/tech/ we should start a b& and do some open source collaborations. It could be fun.
There are very few actual programmers on this board.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064251
>>1064229
>hot take reddit opinions
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064272
>>1064227
Rust is not a productive use of your time.
>>1064227
There are a few git-* repos that we can be found in. Nntpchan is a good start. Pleroma if you're OK with Lains.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064295 >>1064296 >>1064326
>>1064227
>You know what they need? Fucking dank Pepe memes and shit that makes you laugh. And autism jokes.
Programming in Ada 2012 already has that.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064296
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064297
>>1064161
> I sometimes actually have to read documentation and figure out my own solutions.
Oh no, the humanity. Anon, you're not going to learn anything by copy-pasting Stack Overflow, reading the documentation is the normal thing to do.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064301 >>1064351 >>1064372 >>1066506
I got a .txt file input. The first line contains 2 numbers say n and p. The other lines are pairs of some persons IDs which belong to the same group. n in the first line is the total number of persons and p is the number of lines that follow the first line of the .txt file.
One person can not be part of more than one group. I have to find how many pairs of persons I can make with the condition that they're not part of the same group.
What's the most efficient way to do this time complexity wise? Use graphs or something?
Pic related is a simple example
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064326 >>1064334
>>1064295
Pretty ironic since Ada was created by a Turkish Jew; John Ichabod.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064334 >>1064336
>>1064326
A graph seems like overkill.
Here's one way to do it that calculates the result dynamically (because I was too lazy to store the groups in a list and "clean" the list when 2 groups are "merged". That's probably how a normal coder would do it.)
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream myfile;
int n,p;
int **st; //st[s] states which groups the student s is in;
//the value (*st[s]) contains how many students are in st[s].
myfile.open("input.txt");
myfile>>n>>p;
st = new int*[n];
//here is where a nice coder would use a list of the group pointers
int result = 0; // we calculate it dinamically;
int tStudents = 0; // total number of students so far
for(int i=0;i<n;i++){st[i] = NULL;}
int a,b;
for(int i=0;i<p;i++){
myfile>>a>>b;
if((st[a]==NULL)&(st[b]==NULL)){
st[a] = new int;
st[b] = st[a];
*st[a] = 2;
result += tStudents*2;
tStudents+=2;
continue;}
if((st[a]==NULL)){swap(a,b);}
if((st[b]==NULL)){
result += tStudents - (*st[a]);
st[b] = st[a];
*st[a]+=1;
tStudents+=1;
continue;}
if(st[a] != st[b]){
result -= (*st[a])* (*st[b]);
(*st[a])+= (*st[b]);
delete st[b];
st[b] = st[a];}
}
myfile.close();
cout<<result;
return 0;
}
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064336
>>1064334
Ignore that. This code is wrong when multiple people belong to the st[b] group.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064351
>>1064301
O(n) Don't think you need any special data structures.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064357 >>1064677
Happy late birthday to Princess Kylie!
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064372 >>1064802
>>1064301
was bored so I solved it in O(n):
from itertools import accumulate
from operator import *
def c(it):
F = {}
R = {}
for a, b in it:
F[R.get(b,b)] = F.get(a,a)
R[F.get(a,a)] = R.get(b,b)
F[a] = b
R[b] = a
n = []
while F:
A = next(iter(F))
i = 0
while A in F:
i += 1
A = F.pop(A)
n.append(i)
return sum(map(mul, n[1:], accumulate(n, add)))
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064394 >>1064515 >>1065076
Yo I love writing Rust! Even though I am shit at it right now
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064515
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064539 >>1064687
>>1063958
>>1064046
One more question about this parsing thing.. It should be done by using operations on strings?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064584
I have finished reading how to design programs working on cat in racket rn
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064677 >>1065129
>>1064357
Who is this semen demon?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064687
>>1064539
You normally parse the string to a logical structure (a tree), and operate on that.
Steps being tokenization (splitting the string into base entities; eg (25 * x) + (2*y) becomes tokens of (, 25, x, ), +, (, 2, *, y, and )
Followed by parsing, which takes it to a tree: (+, (*, (25, x)), (*, 2,y)))
And then if you want to eg calculate the expression, you recursively calculate its children: x and y evaluate to whatever number, 25 and 2 evaluate to themselves, multiply applies multiplication to its two children, getting back a single result; the two multiply outputs are fed as input to the add function, and theres your final result
The main reason to convert it to a tree is to make eg rearrangement trivial: if you want to make one of the multiplies the top-level operation, you just have to move the nodes around
Which is how you’d do things like optimizations with logical equivalences, eg if you were doing a sequence of matrix operations, you can swap the nodes to make the smaller matrixes come first, to reduce size of future of operations and reduce overall work
And thats the basic structure of a compiler
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064802 >>1064836
>>1064372
Thanks but I'm not used to python can't really read this could you explain the logic what's going on here
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1064836
>>1064802
There are three steps. Lines 5-11 create the groups. 12-19 count their sizes. Line 20 computes the number of pairs. The groups are created using a graph. Each student is a node. F stores the forward edges, R stores the reverse. Every student in a group will be in the same connected component. Given a pairing a,b, we splice the relevant groups together. If a student isn't in the graph yet, it's as if they are in a group all by themselves, such that both forward and reverse edges point to themselves. This is what R.get(b,b) and F.get(a,a) mean. For the second stage we continuously pick an arbitrary student and use F to find all their group members, counting and removing them as we go. For the final stage we compute the sum of the products of every pair of groups. Suppose the group counts are a, b, c, d (for 4 groups). We have S = b*a + c*a + c*b + d*a + d*b + d*c. If we factor we have S = b*a + c*(a+b) + d*(a+b+c). This is the expression the final line computes.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1065076
>>1064394
Keep at it, frend.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1065121
>>1064227
Thanks, I got the Jones linux application development book on library genesis and it seems really good.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1065129 >>1065131
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1065131
>>1065129
Question still applies.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1065273 >>1065277
I remember seeing a picture of programmer challenges, ranging for simple stuff like printing all the even integers in arrays to much tougher things. Does anyone have it saved?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1065277 >>1065294
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1065294
>>1065277
Thanks, man. That's very helpful.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1065307 >>1065612 >>1066309 >>1067616
I've been translating the Wolfenstein 3D and Doom source code into modern C++ and NASM, to re-learn the former, and to get a hang on x86 and x64 Assembly. So far, I've been doing alright. I've been considering reworking both games' graphics code with SDL or Irrlicht, but for now, I'm going one step at a time.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1065612
>>1065307
>modern C++ and NASM, to re-learn the former
What was your previous experience with the language?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1066013 >>1066308
>>1064229
Haven't you seen the do your own web downloader thread? There are a hundred programmers that are regulars here, at least.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1066066
>>1062706
>problems become solvable once you know what you're doing
That's the hard part. If you write some big (+2000 loc) program for yourself, you still have to figure out what the specifics are. If some retard business man gives you something to program, they usually have no fucking clue what they actually want. You have to figure out what they want to accomplish and where this or that feature is implemented logically.
Bottom line is writing up some kind of design which will be the base of what you are going to program. The design will also keep you on point as to what should be in the program to be deemed usable as a starting point. Its easy to get sidetracked without it and waste time on some interesting shit not progressing development.
Programming is just modifying input to output, every retard can do that.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1066308
>>1066013
Yes there are at least 9 people on this board who can write one-liner shell scripts. I stand corrected.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1066309
>>1065307
How are you accounting for interrupt usage? Or are you writing it to still run off of DOS?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1066506
>>1064301
Learning Haskell so I thought I'd give this a shot.
import Data.Graph
import Data.Tree
pairwise :: [a] -> [[a]]
pairwise xs = map (\(x, y) -> [x, y]) (zip xs (tail xs))
parseLn :: String -> (Int, Int)
parseLn s = let [x, y] = words s in (read x, read y)
go :: String -> String
go s = let l:ls = lines s
(n,_) = parseLn l
g = buildG (0, n-1) (map parseLn ls)
ps = concat $ map sequenceA (pairwise (map flatten (components g)))
in show (length ps, ps)
main :: IO ()
main = interact go
Output for the example data is: (6,[[0,2],[0,3],[1,2],[1,3],[4,2],[4,3]])
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1066664
Do any of you have any experience handling Java project dependencies using maven? I'm trying to figure this out but boy I'm not doing too well
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1066667 >>1066668
trying to learn python, know c++ up to functions as well as C, sometimes comparing both of them to python gives me some trouble when resolving tutorial little problems
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1066668
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067020 >>1067036 >>1067095
Strings are terrible. Fuck them and fuck parsing everything in unix land.
>but it's easy to parse
No it's not.
oh shit nigger strtok "extract tokens from strings" damn that sounds like a good way to parse structured data. lmfao read the man page.
>"aaa;;bbb" would return aaa and bbb
Yeah because obviously the ;; is not an empty field or anything. Thank you helpful string util.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067036
>>1067020
That's not strings being terrible, that's strtok being terrible. Use a real lexer.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067095 >>1067144
>>1062567
what's a good non diversity hire language? I've been surrounded with indians for 5+ years in java.
>>1063164
>>1063171
don't be like that the screenshots hurt everyone's eyes it's a bbcode code tag
>>1063821
if it's your first language do the top part, skip gui's java gui's are trash, do JNDI. JAXP, JAXB and not on the list but JAX-RS and JAX-WS; you'll get yourself a jerb.
>>1063961
learn about optional and stop instantiating class variables to null without setting them in the constructor
>>1067020
for maximum linux autism learn awk.
echo -ne "aaa;;bbb\nccc;;;;ddd" | awk 'BEGIN{FS=";";OFS="-";}{print NF,$1,$2,$3,$4}'
what really sucks is when people invent there own non standardized formats, this looks like a ghetto version of csv. also kind of pointless to think about parsing without knowing what you're throwing it into.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067144 >>1067167
>>1067095
csv is already a ghetto format.
>"This is a "quote"","\"","oops",lol
Let me know what your csv parser gives back.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067167
>>1067144
xsv flatten --no-headers test.csv
0 This is a quote""
1 \",oops"
2 lol
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067616 >>1067625
>>1065307
>structure and interpretation of computer programs
>1996
I've seen people talk about this book. Is it just a meme, or is it acutally worthwhile to read it in the current year?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067625 >>1067631 >>1067646
>>1067616
>scheme
It's a meme.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067631 >>1067634
>>1067625
Alright. Good to know.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067634 >>1067819
>>1067631
>weeb image
Actually, I was memeing. Read SICP. It's not a meme.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067646 >>1067649 >>1068093 >>1068094
>>1067625
>It's a meme.
You're wrong, it is actually a language designed better than for example C or C++. I had used C++ and it's nothing special, e.g. its syntax is inconsistent and sometimes ugly. Scheme strings are implemented better than C strings, null-terminated shit, it causes more errors, than have advantages.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067649
>>1067646
>designed better than for example C or C++
Not especially hard tbh.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067819 >>1067822 >>1067834 >>1068078 >>1068198 >>1069359 >>1069406 >>1069619
>>1067634
>programmer
>not a weeb
Get with the times, gramps.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067822
>>1067819
No thanks.
I like being a heterosexual male.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1067834
>>1067819
>Rust isn't in this degenerate image
based
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068078
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068093 >>1068109 >>1068159
>>1067646
Lisp is the gayest shit in the universe.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068094 >>1068112 >>1068159
>>1067646
No useful software has every been written in lisp. Virtually every noteworthy piece of software for which performance is critical and runs directly on computer hardware is written in c/c++.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068109 >>1068159
>>1068093
>Lisp is the gayest shit in the universe.
t. JavaScript web developer
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068112 >>1068159
>>1068094
>No useful software has every been written in lisp. Virtually every noteworthy piece of software for which performance is critical and runs directly on computer hardware is written in c/c++.
Emacs is partially written in emacs lisp.
GNU Guix distribution uses scheme (lisp dialect) as it's main programming language, the package manager is written in scheme and GNU Shepherd - an replacement for sysv init is written entirely in scheme. And Guile - GNU's scheme implementation runs now 4 times faster thanks to JIT compiler, a VM and new low-level bytecode. If a language is fast actually depends on a interpreter/compiler you use. And LISP has different advantages from being fast, for example being hackable - defining syntax rules yourself allows you to create a domain-specific language.
And please stop being such a C weenie. Better learn Rust or something, because it is fasterrrr and saferrr
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068159 >>1068201
>>1068093
based
>>1068094
based, except Emacs exists
>>1068109
based
>>1068112
based
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068198
>>1067819
>PHP
>good intention ruined by error prone tendencies
>Perl
>an awkward lesbian shut-in
This is actually a pretty fair portrayal. If JavaScript had some annotation stating that she is a schizophrenic with crippling dissociative disorder, then I'd say that's dead on.
Could you draw Golang as a obsessively organized but Downs Syndrome affected kid with rich parents? I'm also surprised no Lisps made it.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068201 >>1068203
>>1068159
Core Emacs is written in C, with its Lisp interpreter also written in C
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068203 >>1068218
>>1068201
>Lisp interpreter also written in C
In what Lisp interpreter is written in doesn't matter. There are LISP interpreters and compilers written in LISP, for example chez scheme is written in chez scheme, and parts of GNU Guile written in C are going to be rewritten in scheme. And if emacs used C instead of LISP, that would be a nightmare, you would have to recompile everything and fuck with unnecessary low-level stuff (yes, you don't need low-level to extend a text editor).
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068218 >>1068259 >>1068293
>>1068203
>are going to be rewritten in scheme
Says every academic for the last 30 years. Go back to writing equations on the whiteboard.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068258 >>1068259
Programming on *nix is garbage and everything is a fucking joke.
>oh shit how come stderr doesn't print anything
>fuck it probably tty faggot ancient alien magic
>let me set up some log file
>oh look suddenly the log file isn't being written to
Literally nothing to do with the asshole problem I'm trying to solve anyway. Thank you to the worst tooling system ever invented.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068259 >>1068261
>>1068218
not an argument
>>1068258
based
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068261 >>1068262
>>1068259
>loves LISP
>literally a ni/g/ger
You can't spell LARP without LISP
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068262 >>1068270
>>1068261
>sucks cock for a living
wrong board, faggot
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068270
>>1068262
LISP has never been posted in any of these threads in 5 years. What a totally pointless LARP.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1068293
>>1068218
>Says every academic for the last 30 years. Go back to writing equations on the whiteboard.
Lol, but it actually is going to be rewritten in scheme.
http://wingolog.org/archives/2019/05/24/lightening-run-time-code-generation
<I needed simple because I would need to debug any problems that came up, and I didn't want to add more complexity to the C side of Guile -- eventually I should be migrating this code over to Scheme anyway.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069359 >>1069360 >>1069397
>>1067819
>java
>prim, proper, cheerful, clever-looking, young lady
Based.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069360
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069390 >>1069402
Can anyone help me with this?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069397 >>1069482
>>1069359
> examples with shitty variable names, old non-var variable declaration, annoying italics and colors of members, bizarre and haphazard indentation without any discernible style or logic turning everything into a confusing fucking mess, shitty operator-based string interpolation, and shitty dated GUI libraries
Java is over-verbose, messy, bogged down by historical mistakes and misdesign, but the person who wrote the code in your images would make shitty code in any programming language. Most of the mistakes making that code look shitty are not the fault of Java.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069402 >>1069486
>>1069390
It wants you to use dynamic programming. This means we will need to break down the original problem into a simpler problem. The way we do so is instead of just solving the problem, we a remove the first actual word from the string and solve the problem again. Since you doesn't know the length of the world in question you'll need to branch into two cases. The first is that the word you detected is a word from the actual sentence. The second is that the word you detected was actually just the beginning of a different world. For example if you were given "age" you couldn't just infer "a" is a word since ge isn't a word. You would need to detect "age" as he word.
The problem stated that our alg must have a worst case of no worse than O(n^2). Let's check the worst case of the alg above. The worst cause would be branching after every single letter of the input string of length n. This means the total iterations would be n + (n - 1) + (n - 2) + ... 3 + 2 + 1. This is the same thing as taking the sum of the first n natural numbers. As you'll recall Guass' formula for this is (n^2 + n)/2. Since we are only worried about what happens at the asymptotes (since this is big O notation), we can simplify this to n^2. This means we have satisfied the constraint for the worst performance of the algorithm.
I don't quite understand the second part as you can get multiple solutions. "Again" can be "again" or "a gain." I assume you just output the first solution you find though.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069406 >>1071858 >>1071950
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069482 >>1069508 >>1069541 >>1069653 >>1069656
>>1069397
>shitty operator-based string interpolation
Guy that's learning java and wrote the code here. What's bad and "shitty" about it?
>and shitty dated GUI libraries
Are you saying that java devs need to know javafx?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069486 >>1069645
>>1069402
I guess it means if all the substrings are vaild dictionary words, just print the newly created string. Suggests one must give both an analytical answer and a pratical example.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069487
I guess I now know why Terry's software renderer doesn't support textures, they kill the already lackluster performance. I have a shitty Core 2 Duo and not a i7 or Xeon though, so idk. Lower resolution and less colors might also make things faster.
Btw, if you feel like he's staring at you all the time that's because of affine texture mapping, the same method PSX used.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069508 >>1069656 >>1070491
>>1069482
The main shitty thing is that it's basically an inefficient hack. Behind the scenes, the Java compiler translates the operators into a StringBuilder with a bunch of appends. If you're doing a bunch of them, it's going to be far slower than true interpolation, like String.format or something of the sort.
The main point, though, is just that it's ugly and less readable, with a bunch of syntactic noise:
"My name is " + name + " and I am " + age + " years old. My job title is \"" + job "\"";
// versus
String.format("My name is %s and I am %d years old. My job title is \"%s\"", name, age, job)
Kotlin does it way better, though, with proper string interpolation:
"My name is $name and I am $age years old. My job title is \"$job\""
Javafx or whatever you like. Swing is just hideous and the API is disgusting. Also, use a formatter or IDE. The majority of the readability issues there are just your fucked up indentation, redundant information, and Swing cruft rather than Java itself.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069509 >>1069525 >>1069527 >>1069557 >>1069626
So I've used Python for years and am very comfortable with it. I've been using Golang over the past couple months and appreciate its simplicity and very useful standard library. I can see it replacing my use of Python for most cases.
I would like to work with something that has good performance and can run on minimal hardware. I can read (not write) C and don't want to deal with having to define really basic operations. I really don't want to invest the years it takes to get good enough with C++ to write working software. Give it to me straight, /tech/. Is Rust really the best alternative to C++?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069525 >>1069551 >>1069603
>>1069509
lua/luajit unironically. Simple and elegant, will remind you a lot of golang, just with less bloat. Also don't let yourself be fooled by the fact that it's an interpreted language, it's positively tiny and in some scenarios, a well-written luajit program can easily keep up with C (yes, that C) speedwise. It also runs on very minimal hardware and in restricted environments. I've had lua scripts run in DOS on 100 Mhz Pentiums with 8 MB of RAM. It doesn't get much more minimal than that. Try that with rust or go.
I love this language since it's so minimal and doesn't tell you how to do things, at all. Want OOP, functional or procedural? Implement it, nothing is stopping you. It's pure elegance. Way underrated imho. The freedom can be overwhelming for some though since you can do whatever without clear guidelines to do things, which I have observed is actually a hindrance for programmers that are used to "stricter" languages. It's also easy to write inefficient lua programs if you are bad at programming. It also doesn't have the 39825823582502 libraries ready to import, without which java and python devs would often be helpless.
Contrary to popular opinion, it's also entirely possible to write big programs in lua, you just need good tools for linting and static analysis.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069527
>>1069509
>Is Rust really the best alternative to C++?
Certainly not, Rust can't even compile itself on the "minimal hardware" you're likely thinking of (unless xu6_64 counts as minimal) without running out of registers.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069541 >>1070491
>>1069482
It's useful if you don't have another language, but no one should be doing java ui's other than maybe android devs, and knowing how shit javafx and swing are I'd give a look at writing it in go first.
Java's great for plenty of things complex business systems, rest, soap message busses, any kind of data storage, many more things I don't feel like listing, but it's ui's are trash just slap up a web service and write a client for it in another language to do your ui with.
I'm in the midst of making that mistake with javafx now not a day goes by I don't wish I'd just said fuck it and made the thick client an electron app.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069551
>>1069525
Hakase, is that you?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069557 >>1069636
>>1069509
Golang really is a great language for a lot of use-cases, particularly when paired with Electron or a plain browser. I'm in the process of replacing a lot of Excel and Access crap with homemade Electron apps in my accounting work. Fuck VBA, life's too short for that shit.
The standard library is really solid, I love that I can basically jettison Apache and PHP entirely from my life. Good riddance to them. And I don't need to make sure some entire damn interpreter stack with hundred optional packages is installed on the machine on which my program runs, because it compiles to a single static binary. Drop the binary on the office server, restart the service, done. My life is simpler and calmer.
And I love love love how readable it all is. Golang has no style-guide debate bullshit, like certain other languages (coughCcough). I can't remember the last time I opened someone else's Golang source and wasn't able to instantly follow the logic. More languages could use something like gofmt.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069603 >>1069613
>>1069525
that lua love2d engine is actually pretty OK on android
lua is almost a general purpose language
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069613
>>1069603
Android and iOS don't allow LuaJIT do they? Would be a pretty big penalty on performance to fall back on regular Lua.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069619
>>1067819
Based Javascript tomboy.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069626 >>1069634 >>1069636
>>1069509
Did Go ever get package management or is it still a joke?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069634
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069636 >>1069643
>>1069557
Glad to hear that it's going so well. I've found the template and net packages really useful for automating administrative tasks related to my job (civil engineering).
I'm not sure if I can write my own tools in Go to do some of the graphics and geometry processing I keep promising myself that I will do someday. I would love to never pay for an Autodesk license as long as I live.
>>1069626
What is good dependency management in your opinion? I don't know if NPM and its clone Cargo are good tools. They seem to lead to the ecosystem becoming a huge trash-heap of half-finished and poorly maintained packages. How secure is that third version of some random guy's code that's nested four levels deep in your dependency tree? That's way too much trust for me. I read a comment once that every programming language package manager is just a worse reimplementation of dpkg, and I tend to agree.
Go modules are available now, though, and will be standard in 1.13 (proposed release in August). So far it looks easier to manage, but it is a middle finger to the people who worked on godep. It's easy to forget that Go is a trademarked Google language and all decisions are underpinned by Google's needs and financial considerations.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069643
>>1069636
>It's easy to forget that Go is a trademarked Google language and all decisions are underpinned by Google's needs and financial considerations.
Yeah, this is my one concern with the language. Granted, it's developed and shepherded by extremely smart and accomplished people. And Google's implementation is under a super-permissive license. And the reference implementation doesn't have any phone-home telemetry sketchiness. And it's such a perfect language for my beginner-skill-level and specific problem sets.
But yeah, it is very much a Google-owned project. Such is life...
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069645
>>1069486
It suggest whoever wrote the question didn't know what they were asking for. Which is super common for retarded coding questions.
Most of them are just guess what I'm thinking or come up with the same solution I did.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069649
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069653 >>1070491
>>1069482
>Are you saying that java devs need to know javafx?
Yes, JavaFX is actually really nice, both in performance and as a development experience. You can separate your presentation and behavior code, because it has a declarative .fxml format (which can be generated by a scene builder tool) and behavioral stuff goes in a separate file. Swing is just a terrible design; its only virtue is that it comes with old version of Java so it's still used in Enterprise software, but that will change over time. All new Java GUIs should be built using JavaFX.
If you want to play around with JavaFX, download the Gluon Scene Builder. You'll never go back to Swing after learning JavaFX.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069656 >>1070491
>>1069482
>>1069508
>Behind the scenes, the Java compiler translates the operators into a StringBuilder with a bunch of appends
Only for Java 8 and older. Newer versions of Java generate bytecode which performance an invokedynamic on StringConcatFactory::makeConcatWithConstants(), and its quite a bit more performant than StringBuilder (avoids buffer reallocations) and even String::format (which does format parsing, possible boxing/unboxing, and array allocation for each call).
In summary, you should always use the + operator to concatenate strings in Java, and compile with JDK 9+.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069680
>>1062447
altGr + right blue button
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069711 >>1069718 >>1069730 >>1069731
Why has the industry not developed new systems languages to better take advantage of multi-core cpus?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069718
>>1069711
Do you believe that the current languages are inadequate for this purpose?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069721 >>1069730 >>1069757 >>1071469
Best book to learn a useful assembly language? I have tried to pick up programming as a hobby a few times but I am more interested in the nitty gritty "bare metal" stuff than I am in making anything of real value yet.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069730 >>1069733
>>1069711
I was kind of under the impression that multicore processing is exactly why we got a wave of new languages with major corporate backing in the last decade (Go and Rust, for example). Erlang has had the ability to run a scheduler per core for a while.
I would even say that the shine is fading on the recent convoluted solutions to single-threaded runtimes (like python and JS) that have become popular (ie, callbacks -> futures -> async/await). I'm waiting to core contributors to my favorite languages to realize that callback-chaining was tried a long time ago and wasn't widely adopted for good reason. It's pretty hard to reason about code where part of it is executed sequentially and part of it is executed or fails at an indeterminable time in the future.
https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/
>>1069721
pic related
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069731 >>1069733
>>1069711
>What the hell is multi-threading
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069733 >>1069751
>>1069731
>>1069730
I was hoping some company would try to replace C/C++ on the back of 'multi-core' programming with something memory safe. Go is my first web dev for Google and Rust is rusting away in its safe space.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069751
>>1069733
Maybe GNAT is more to your taste? Swift is a thing if you'll marry yourself to iOS. It's linux support is . . . not good.
Golang is genuinely useful. You can also learn it in a weekend. Just don't expect to do a bunch of Clojuretricks. Rust is a good idea with a cautionary tale of bikeshedding to learn from it. I think in 2-5 years, we will see a lot of the cruft disappear as big tech pushes out the Steve Klabniks of the dev team.
That or somebody will fork it and drop all the bullshit and keep the good parts.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069755 >>1069758 >>1069762
Go is 10 years old. Rust is 9 years old.
Language development died in the 2010s. So did software development. In fact a lot of shit just stalled totally with the great recession.
30 years of javascript and php. oh but don't listen to a fag like me who says we are in a dark age nah just around the corner in the next 10-20 years we will have a replacement for something that wasn't even well designed in the 70s. In the mean time why not revisit the JVM or write a fat webapp or write assembly for some chinko device, what a time to be alive.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069757
>>1069721
I've not finished it yet, but I've found x86-64 Assembly Language Programming with Ubuntu by Ed Jorgensen to be helpful. You don't have to use Ubuntu, but you do need yasm.
http://www.egr.unlv.edu/%7Eed/x86.html
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069758 >>1069760 >>1069761 >>1069837
>>1069755
I hate to sound like a commie but I blame corporate America. They have systems that work so the best course of action is to just patch the old system with whatever is new. It explains why we still have C/C++ around.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069760
>>1069758
Damn corporations and their working systems! Gnu Herd would be released and written in a truly proletariat language if it weren't for these greedy porkies.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069761 >>1069837
>>1069758
nah the issue isn't that corps are slow and conservative to change.
I mean what is the business model of the modern tech corp? Exchange rep for money pretty much. Same as the video game industry, bankers etc.
Literally nothing to do with tech at all. It's no wonder most of their nigger cattle board are essentially political CFR faggots. What the fuck do you need to know about the internet to run jewgle? or faceberg? Is even 10% of their business technical.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069762 >>1069765 >>1069766
>>1069755
Jai will save us all
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069765
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069766
>>1069762
But gamergate won.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069811 >>1069825
I just want to throw my ten cents in. I've been in love with C since I was a kid. I still feel amateurish when using C and there are always more libraries constantly changing than one could ever know what to do with. The only reason I touch Python is for BeautifulSoup4 because it would be a nightmare to parse HTML in C unfortunately. It is only really a requirement for scraping websites anyway.
What makes C so great is that once you know what you're doing, most of everything in *IX operating systems is available for your own customizations and you can now contribute/submit PRs to actual prolific projects in the open source world. It's such a rush to have a grasp on something that matters and not some skiddie php copypasta. I used to spend months trying to figure out why bash scripts didn't behave the way I expected them to and now that I moderately understand C, I have no reason to play with scripts in the first place.
The most recent success I can claim is that I've delved into gdb (I used to use Visual Studio) and I'm now more confident in developing portable code as I debug existing projects listing code and probing variables to understand how my peers and predecessors do things.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069825
>>1069811
>LARPing as a Cnile
pretty convincing desu
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069829 >>1069830 >>1069864 >>1070022 >>1070492
Anyone has any experience on Haxe? I need to make a cross-compilable "game" on all common platforms (Gahnoo, Wintendo, hOmoSeX, smartphones, etc) and web as well. I guess I will end up switching the GUI around for desktop and phones, but I'd rather not have to rewrite the core "world" framebuffer just to get it working in other places. Game is going to be 3D, but nothing too complex or resource intensive.
Also, if you have used Haxe, have you used HaxeUI? Looks nice, but I dunno.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069830 >>1069833
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069833 >>1069853
>>1069830
Yeah, no. I'd rather not go insane with Rust itself and emscripten and JNI and whatever iOS has to convolute the use of non officially sanctioned languages.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069837
>>1069758
How much time have you spent porting bad legacy code to not-C for no pay at all?
>>1069761
Spooky, but probably true.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069853 >>1070943
>>1069833
Just compile to Wasm for Android/iOS/Web.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1069864
>>1069829
Ask around on /v/'s /agdg/ threads. One of the yesdevs there has shipped two games written in Haxe, one of them 3D.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070022
>>1069829
>var foo:Bool
>foo is null on dynamic targets
>foo is false on static targets
If they can fuck up something this basic I've got zero faith in the rest of it.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070033 >>1070048 >>1070492
https://www.jetbrains.com/lp/devecosystem-2019/
Parrot the popular responses here so you seem less like a nodev
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070048
>>1070033
>having a popular opinion
>/tech/
you came to the wrong board bucko
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070491
>>1069656
>>1069653
>>1069508
>>1069541
Thanks, dudes. I think I'll try Gluon Scene Builder and add javafx to the list of stuff to learn.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070492
>>1070033
>doesn't realize this is polled from a majority of pajeets
>>1069829
SDL is the better meme, but HAXE werks.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070522 >>1070524 >>1070529 >>1070533 >>1070564 >>1070578
How long did it take you guys to "git gud", I've been struggling to grasp the fundamental concepts of programming, like recursion and those sorts of things. I think I'm a brainlet. I've been studying SICP and learning about Data Structures and Algorithms but it just won't click for me. I can write some stuff in python and now I'm trying to learn C but I feel like I'm not getting anywhere. Any advice?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070524
>>1070522
SICP is rather hard for a beginner.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070529
>>1070522
it takes about 10 years.
This is a meme and also the truth.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070533
>>1070522
practice. The first step is the art of solving problems with a poor (inefficient, naive, overcomplicated) solution. As you continue practising, you can revise your older solutions and consider ways to improve the logic in some way. It is only with practise and consistent critical evaluation that your skills will improve.
I recommend the Khan Academy programming course because it contains a significant number of programming challenges that are designed to build up your knowledge and experience piece by piece.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070564 >>1070666
>>1070522
Stop reading memes and actually write code.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070578 >>1070731
>>1063409
I'd assume it is simple reference counting and you shouldn't free stuff, but dereference it instead.
https://en.wikipedia.org/wiki/Reference_counting
https://en.wikipedia.org/wiki/Tracing_garbage_collection
>>1070522
Could be that you think things are more complicated than they are, because you are insecure about your capabilities. Everyone can program. Not many want to. You could join an IRC channel and ask your questions as they come up.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070666
>>1070564
>Stop reading memes and actually write code.
Memes are code you run on wetware. ;^)
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070669 >>1070687
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070687
>>1070669
wow, this is the worst programming bundle I've seen yet. Not sure how it could get worse and not actually be an "iOS dev bundle" or some other niche topic.
These are books designed, not to appeal on their own, but to be the only book on the shelf when you go to the only bookstore in the area to pick up something for your resume.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070689 >>1070701
Should I learn Ada if I hate Jews?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070701 >>1070714
>>1070689
No you should go to therapy.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070714 >>1070730 >>1070970
>>1070701
>(((therapy)))
I guess I hit a nerve, huh? I will learn Ada now.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070730 >>1070816 >>1070840
>>1070714
I've been mulling that idea. Some autistic chink has been spamming Ada praise on his resume-promotion blog and HN. I wasted 3 months on Rust just to learn that to do anything significant you end up using bindings or an FFI to C++ libraries anyway. So you avoid scary C++ by calling C++. The safety guarantees are ultimately "dude, trust me." The dependency growth is also Nodenigger tier. Especially because the standard lib doesn't support shit that is actually useful (like argparsing or unmarshaling data to a struct without a fucking opaque macro) and supports way too much shit you should not be using regularly (like async).
I do find a lot of appeal in a language with strong safety guarantees and performance, though. Not many options on the table other than Ada, it seems.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070731
>>1070578
>that title
GitS cyberbrains when?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070777 >>1070783 >>1070792 >>1070840
What's the point in learning other new languages in the context of actual applications when most modern OSs still use x86 based assembly for which C is the most optimized?
Yeah, for toying with interesting concepts other languages might be good, but unless there's some connection between a high-level language, the low-level language, and the hardware, it seems moot.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070783
>>1070777
Developer productivity.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070792 >>1070831
>>1070777
>modern OSes use assembly
>C is the most optimized for assembly
hell, C compilers are better at optimizing generated C code than they are hand-written C code. Even if you had some kind of phobia of abstraction, you could use D with -betterC
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070816
>>1070730
I figured that's basically what rust was.
I've took a stab at Ada but its syntax isn't clicking right now. Needed to mess with some tcl early this year though and fell in love and can't stop using it.
Still have Ada on the back burner, but I have too much stuff in C or C++ to work on.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070831
>>1070792
generated C code is generated from something
C++ traditionally preprocessed into C as an intermediate step, LLVM may have an improved pathway for this but compiler optimizations tend to be language agnostic and C has a wide range of compilers. The difference between C and emerging languages is that decades of optimization work have been put in, you won't find that with newer languages so much, although if LLVM has front-ends for your preferred language you may be able to take advantage of compiler optimizations one usually only finds for C/C++
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070840 >>1070860 >>1070938
>>1070730
>to do anything significant you end up using bindings or an FFI to C++ libraries anyway.
wrong
>Especially because the standard lib doesn't support shit that is actually useful (like argparsing or unmarshaling data to a struct without a fucking opaque macro)
But that's a good thing. Just take a look at any language that has shit like that in its std.
>>1070777
>being this cnile
Have fun with your UB.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070860 >>1070865
>>1070840
>rust has defined behavior
lol
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070865 >>1070868 >>1070871
>>1070860
Who are you quoting?
But yes, Rust currently has UB because it uses LLVM. LLVM is full of braindamage.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070868 >>1070875
>>1070865
Rewrite LLVM in Rust
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070871
>>1070865
as opposed to what? Visual Studio? GCC?
LLVM is the only option afaik
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070875
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070938 >>1070941
>>1070840
GUI is still basically all GTK or QT bindings. Conrod really isn't there. Math boils down to BLAS or LAPACK bindings because nalgebra's API is a bad joke. And languages that can unmarshal structured data like JSON are actually useful. Shit, dude, that's the basis of every fucking REST API! But, hey, I can overload operators and define macros until my code is an unintelligible DSL! Can I get a fucking PCRE, please?! Can I get a god damn reference implementation of HTTP routing and abstraction for headers?!
>Rust is great for CLI!
<How do I handle flags/switches?
>uhh, check Cargo
>Rust is great for web!
<How do I consume data from a REST API?
>uhh, check Cargo
>Rust is great for embedded!
<I have microcontroller that isn't a raspberry pi
>uhh...
>Rust is great for web assembly!
<But web assembly is actually slower than regular JS and webGL
>uhh...
It's not that Rust is awful, but it grossly under-delivers on its promises and has questionable priorities.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070941 >>1070943 >>1070988
>>1070938
>GUI is still basically all GTK or QT bindings.
That is true for every language though.
>Math boils down to BLAS or LAPACK bindings because nalgebra's API is a bad joke.
True, nalgebra is pretty horrific. Why would you use Rust for math though? Use Julia.
>JSON
https://github.com/serde-rs/json
https://github.com/maciejhirsz/json-rust
>Can I get a fucking PCRE, please?!
https://github.com/rust-lang/regex
>Can I get a god damn reference implementation of HTTP routing and abstraction for headers?!
I don't really know what HTTP routing is.
https://github.com/hyperium/http
>muh CLI
Just take a fucking look at Python. 3 fucking different approaches to argument parsing in its std alone.
Fuck off. Argument parsing has NO place in Rust's std.
>muh REST APIs
Wtf does that even mean? Stop repeating webdev buzzwords. I already told you how to handle JSON. If you just want a simple HTTP client API use reqwest.
>muh embedded
https://forge.rust-lang.org/platform-support.html
>muh web assembly
Fuck off webdev nigger.
>Rust grossly under-delivers on its promises
Rust never promised to have webdev tier shit in its std though.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070943 >>1070946
>>1069853
>rust can be used for the web just use webassembly lmao rust 4 lyfe
<but webassembly is shit
>>1070941
>lol why do you even want to do webdev lmao rust 4 lyfe
Rust shills, everyone.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070946 >>1070957
>>1070943
>>lol why do you even want to do webdev lmao rust 4 lyfe
Who are you quoting?
https://github.com/actix/actix-web
https://github.com/hyperium/hyper
sage negated btw
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070957 >>1070963
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070960 >>1070962
How do I make sure I get a high paying job in computer science? I just started college.
The goal is to get a job over 100,000 asap and then a job 200,000+ eventually
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070962 >>1071168
>>1070960
Take a graphic design course (make sure the rims in your teacher's glasses are at least 7mm thick), then learn all (see: ALL) the latest javascript frameworks and how to use Electron.
It helps to know some basic computer science so you can avoid things that result in fast software.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070963 >>1070973
>>1070957
>projecting
sage negated
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070970 >>1070975
>>1070714
Ada is great, but your hate is irrational and being irrational is not useful in a programming context.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070973 >>1070975
>>1070963
>be super concerned about safety
>cut off own genitals
what did the rustranny mean by this?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070975 >>1070995
>>1070970
>hating kikes is irrational
get out
>>1070973
nice meme
btw GCC is allowed to cut off your genitals if you don't terminate your source files with a line feed.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070988 >>1071001
>>1070941
Nodenigger, the whole argument that you need to lrn2rust is because C++ is inherently unsafe and your programs will be full of RCE bugs . . . but C++ is OK for my GUI. Retarded.
Regex crate doesn't support look around, which is a big part of PCRE.
Python arg parsing exists and that alone makes it better than Rust. Go's flag package is even better.
And how do you not know what a REST API is? Holy shit, dude, you sound like a highschool nodev.
Each of those points are from Rust-lang.org's front fucking page. I didnt pick them. And none of them are even practical without using random people's v0.x shit off Cargo. Nobody else seems to have a problem shipping standard solutions to these extremely common problems in their nulangs. Fucking nim has JSON parsing. How much budget does that dev team have? How is one guy with a couple sponsors more productive than Mozilla who has half a billion in annual revenue? I know that defending Rust is a troll, but have some self-respect.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1070995
>>1070975
>tfw your editor automatically inserts trailing line feed at the end of your file
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071001 >>1071007
>>1070988
>Nodenigger
I'm the Rustnigger though
>but C++ is OK for my GUI
I did not say that.
>Regex crate doesn't support look around
Good. Rust's regex crate guarantees linear time matching on all inputs.
>Python arg parsing exists
Yes. 3 times in the std alone.
>Go's flag package
Is stripped down to the point of unusability, just like the language itself.
>And how do you not know what a REST API is?
Are you retarded? Read my post again. Then read https://en.wikipedia.org/wiki/Representational_state_transfer. REST is a meaningless buzzwords.
>And none of them are even practical without using random people's v0.x shit off Cargo.
CLI: Use clap. Currently on major version 2.
JSON: Use serde-sjson. Currently on major version 1.
HTTP: Use actix-web. Currently on majoir version 1.
Kill yourself you lying faggot.
JSON has no place in Rust's std. Rust is neither a scripting language nor a webdev language. It is a system programming language. Guess what other system programming languages also do not have JSON/HTTP/argument parsing in their std? C and C++.
>but muh Nim
some random person's v0.x language. epic
>I know that defending Rust is a troll
<everyone who isn't Cnile is a troll
Your cnility is showing.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071007 >>1071013
>>1071001
>REST is meaningless
Your Google education is impressive. It's almost as if you've written a real program once.
>CLAP, SerDe, Actix
Check the dependency tree, Mr. Gender Dysphoria. And name one project actually using Actix. M$'s mystery project? It's all hype. There's already a well established actor model for networking, and it's Erlang. Everything old will be new again, it seems. Just like how hipster devs are discovering standard MLs 36 year old type system and getting woke on functional programming. Runtime errors moved to compiler errors (so I can be lazy and write no tests)? Far out maaaaaaaan.
C++ was standardized in 1985. JSON was standardized in 2013. No shit STD doesn't support it, but ISO doesn't have some gay website purporting that C++ is the one true lang for web development and servers. Rust does.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071013 >>1071021 >>1071030
>>1071007
>Your Google education is impressive
I have a master's degree in computer science. You're just a Cnile LARPer.
>Check the dependency tree
Check the source of anything written in C/C++. UBs everywhere.
>Mr. Gender Dysphoria
Now that's just sad. What a weak insult.
>name one project actually using Actix
https://bible.rs/
Also Cloudflare uses it for the image resizing feature.
>There's already a well established actor model for networking, and it's Erlang.
actix-web v1.0 isn't based on the Actor model anymore btw. It is now based on something similar to this: https://monkey.org/~marius/funsrv.pdf
You have yet to make a convincing case for why Rust should have JSON support in its std btw.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071021 >>1071091
>>1071013
>i have a master's degree in computer science
lmao the day has finally come a pajeet tranny on /tech/.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071030 >>1071044
>>1071013
>Masters from university of Mumbai.
>No mention of production code
Sounds about right.
>bible.rs
>JSON unnecessary
Check out all the xhr's spawned by the search bar in that example you just looked up on github because you couldn't think of a serious example. Huh. A REST API? I wonder if that's something web servers need to deal with on a regular basis...
And your shining example would have been much more simply implemented as a static site with elastic search.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071044 >>1071072
>>1071030
>incoherent babbling sprinkled with misquotes
Just admit that I destroyed you with facts and logic. Stop behaving like a child (you probably are one though).
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071072 >>1071143
>>1071044
The fact that you have demonstrably no knowledge of what you're talking about. I've been arguing with the top 3 Google results this entire time. Post your git repo or GTFO nodev.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071091
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071143
>>1071072
Your Google education is impressive. It's almost as if you've written a real program once.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071168
>>1070962
Accurate advice. ReactJS and Electron developers are earning crazy amounts of money. Just keep in mind that these frameworks will be discarded for the next hot thing in a couple years, just as their predecessors were..
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071282 >>1071440
Best programming socks to increase productivity while writing C?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071438 >>1072008 >>1076481
As a long-time C++ developer looking for ways to improve my coding approach, I recently purchased this book and have been slowly working my way through it. Functional Programming in C++ by Ivan Čukić. Basically, it's about programming in C++ using most of the elegance of Haskell's functional approach, but with all the power and performance and flexibility of C++.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071440 >>1071441
>>1071282
SOCK_STREAM if you want layered
SOCK_DGRAM if you don’t have any requests
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071441
>>1071440
kek. he's a faggot anon, xir's not talking about network programming.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071447 >>1071467 >>1071513
>>1062802
hadn't even heard of crystal or Nim till this thread
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071466 >>1071522
>>1062467
>Nigger, linked lists aren't hard. You learn how to do those in your first semester at university. After that you never use them again because they suck.
Who tf actually learns how to do linked lists in uni I was doing them when I was like 16
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071467
>>1071447
Crystal is what Ratwires is written in
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071469
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071513 >>1071522
>>1071447
Nim is pretty comfy. If you're familiar with Python, then I think you will be very comfortable with the syntax. It lets you compile to C/C++/JS with a lot of options (like which compiler to use), so compatibility is not a problem. It's governed by a BDFL and targeted at game developers.
Crystal has a similar goal, but for Ruby. Crystal had a bit of an upset when its sponsor company abandoned the project though. There is still active development; however.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071522 >>1071527 >>1071591 >>1071912
>>1071466
>Who tf actually learns how to do linked lists in uni
Anyone who studies Computer Science?
>>1071513
>nim compiler will error if you don't use the BDFL favorite indentation
what did he mean by this?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071527 >>1071529 >>1071531
>>1071522
it errors out if you use hard tabs. There's no error in general on style. You can start your source with a one-line source filter to translate the tabs, and one person actually does this, but you'll want way too many levels of indentation for hard tabs to make sense. Just use two spaces.
Crystal really is targeting Ruby. Nim is not targeting Python. Nim is better than Python.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071529 >>1071531 >>1071598
>>1071527
>it errors out if you use hard tabs.
>You can start your source with a one-line source filter to translate the tabs
What kind of braindamage is this? Holy shit.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071531 >>1071576
>>1071527
>>1071529
Nim's significant white space sounds like much more of an issue than it is. It's never bothered me when I was writing things in it, despite initially balking at the idea. The only thing I wish it had was optional curly braces or something to make blocks clearer. It used to have an undocumented option for that but it was removed in 0.19.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071576 >>1071586 >>1071592 >>1071598 >>1071602 >>1071867
>>1071531
>Nim's significant white space sounds like much more of an issue than it is.
It is a significant issue. Indentation should be 8 spaces wide. Nim's is 2. LOL
https://www.kernel.org/doc/html/latest/process/coding-style.html
>Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3.
>Rationale: The whole idea behind indentation is to clearly define where a block of control starts and ends. Especially when you’ve been looking at your screen for 20 straight hours, you’ll find it a lot easier to see how the indentation works if you have large indentations.
>Now, some people will claim that having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen. The answer to that is that if you need more than 3 levels of indentation, you’re screwed anyway, and should fix your program.
>In short, 8-char indents make things easier to read, and have the added benefit of warning you when you’re nesting your functions too deep. Heed that warning.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071586
>>1071576
8 space tabs are just wrong, and are responsible for many problems in the world such as global-warming and the fact people wear ugly colored clothing in public. This is factual, this is objectively true.
2 spaces not tabs are goat-tier and always will tbh.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071591 >>1071738
>>1071522
>Anyone who studies Computer Science?
Can you read?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071592 >>1071738
>>1071576
8 spaces is a waste of bytes
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071598 >>1071738 >>1071818
>>1071576
>Indentation should be 8 spaces
8 spaces is fine for kernel-style C. Nim looks like shit with 8 spaces. It's completely acceptable with 2 spaces. Nim uses indentation a lot more than other languages, with `when` compile-time blocks, variable declaration blocks, etc.
>>1071529
yeah so don't use source filters and just use two fucking spaces. This is trivial shit. You've still got Nim's partial style insensitive to freak out over.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071602
>>1071576
Linus you are breaking the CoCk again with your autism. Please see your daughter for some more re-education.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071738 >>1071930
Holy shit, so many triggered LARPers. You use tabs for indentation and spaces for alignment. 1 tab is 8 spaces wide. 4 spaces is kinda acceptable but 2 is just garbage and you need to kys ASAP.
>>1071591
Did you go to university or are you LARPing?
>>1071592
It's 1 tab. 1 tab is 8 spaces wide.
>>1071598
>Nim looks like shit with 8 spaces.
Now, some people will claim that having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen. The answer to that is that if you need more than 3 levels of indentation, you’re screwed anyway, and should fix your program.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071746 >>1071748
Reminder to ignore (you) hungry faggots that think no /tech/ threads should have real discussion.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071748
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071818
>>1071598
>You've still got Nim's partial style insensitive to freak out over.
This is the real bugger.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071858
>>1069406
I fully endorse this post.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071867
>>1071576
i prefer tabs, but 4 space wide tabs. should i seek help?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071868 >>1071883 >>1071886 >>1071993
Anything besides tab character is retard-tier for indentation.
You need special editor functionality to move the cursor between space-tabs, special editor functionality to indent your code without mashing the space bar multiple times, doesn't show the span of the tab properly without even more special editor functionality, adds a huge amount of extra characters for no reason, and actual tabs can be adjusted to each individual's preference so dyslexic retards can make it 8 spaces long and hipsters can put it to 3 while >80 IQ people can keep it at 4.
Also if you use spaces to align words horizontally beyond just indentation, then you need to seek mental help and a course in not wasting everyone's time at refactoring level. There's never not a better way to make things readable and organized.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071883
>>1071868
>so dyslexic retards can make it 8 spaces long
cries in not having my .vimrc on new machine
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071884 >>1071887 >>1071912
>learned programming essentials
WHAT TO DO NEXT IM A DUMBASS
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071886 >>1071887
>>1071868
>hipsters can put it to 3
we put it to 2
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071887 >>1071888
>>1071884
pick a language, read it's associated meme books. try to implement euler problems as you go https://projecteuler.net/archives
then find some websites rest api, implement a client/useage for it, put the github on your resume and take your free job ticket.
>>1071886
if (true)
{
//embrace true fagotry
}
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071888
>>1071887
I always use two spaces on my own projects. Anything more is just wasting space.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071912
>>1071522
Nim's white space autism is a very teachable point in how languages evolve based on their governance model.
Rust, for instance, is close to democracy. Mob rule and grand-standers control the language direction and feature bloat is unstoppable. Bikeshedding Hell ensues. The language is doomed to become a highly complicated, incoherent mess as it tries to become everything to everyone. It's an imperative-procedural-functional-asynchronous-safe-meta-next-big-thing-paradigm language.
C++/JS have Republican governance. Public opinion is filtered through councils of an elite caste who represent varied interested groups. It has all the problems of Democracy, but implements them more slowly. These languages are also doomed to become a complicated, incoherent mess.
C#/Java/Go have oligarchs. All decisions are made by a small group representing one powerful entity (company). The oligarchs might care or pretend to care about the rabble, but all language decisions are made based on the bottom line of the oligarchs' company. These tend to have relatively consistent semantics or implementation, but have trouble evolving.
Nim/Perl/Old Python have (or had) autocratic governance. They have clear and consistent style and implementation, littered with their BDFL's personal idiosyncrasies and taste. You can take the language, warts and all, or leave it. Python made popular choices, and in Perl 6's case, the response to design quirks is a resounding "no, thanks."
The LISP family is anarchy. Nobody is really in charge. Anyone can make any implementation they want. Small, ephemeral tribes coalesce around a few flavors, but consistency is impossible.
>>1071884
Think of a simple problem. Google how to solve it in some language you want to learn. Solve it. Find a bigger problem. Repeat.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071930 >>1071942
>>1071738
>Did you go to university or are you LARPing?
The whole point was that I didn't go to university because who tf pays out the ass just to be taught basic shit like linked lists?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071942 >>1071966
>>1071930
Linked lists came up in to lectures when I studied.
1. semester in the Introduction to Programming lecture. I didn't attend this one because I already could program.
2. semester in the Algorithms and Datastructures lecture. Done in <10 minutes.
>I didn't go to university
No shit. You're just a dumb LARPer. You learn all kinds of shit in uni but you're too brainless to pass the exams LMAO
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071947 >>1072227
>>1062285
What languages were you coming from?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071950
>>1069406
This. Go has all but replaced my python that I've been writing. Channels and goroutines make parallel code damn near trivial. That being said, calling a C function from Go is comparable to simply spawning an entire new process, making CGO effectively redundant.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071966 >>1071971
>>1071942
Lmao you dumb fuck I get paid exorbitant amounts of money to write actual software, you just have a piece of paper and debt. Please tell me what 'kinds of shit' you learnt in uni that I can't bring up with a simple Google.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071971 >>1071972
>>1071966
>everyone is a burger
No you retard. I'm europoor. I didn't pay for university. In fact I got paid by the university.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071972
>>1071971
Oh in that case well done on your degree
also I'm a britbongistani not a burger
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1071993 >>1072067
>>1071868
Tabs are for tabulation (see?). When I'm writing text files, including code, I regularly want to intersperse them with tables. When you make a table, 8 char tabs is the absolute minimum. For indentation, 8 spaces is way too much.
When writing any text file, including source code, I often want to align something with the previous line. Unless you set your tab to one character, this needs to be done with spaces. But mixing tabs and spaces is peak retardation.
>special editor functions
Then get a special editor. Next you'll complain about long variable names without autofill or long files that you can't jump to a position in.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072008 >>1072067
>>1071438
There is high demand for 'functional' style C++, you can easily achieve Rust-style so-called safety with it.
For a different subject if you're interested in parallel C++, see this CMU book: http://www.cs.cmu.edu/afs/cs/academic/class/15210-f15/www/pasl.html
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072067 >>1072163 >>1072240
>>1071993
>Unless you set your tab to one character, this needs to be done with spaces. But mixing tabs and spaces is peak retardation.
Wow. You're retarded. What part about "tabs for indentation spaces for alignment" don't you understand?
>>1072008
>you can easily achieve Rust-style so-called safety with it.
You can't. Modern C++ is not memory safe.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072163
>>1072067
Should have used Ada
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072227
>>1071947
>responding to a post that's 3 weeks old
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072240 >>1072257 >>1072304 >>1072310
>>1072067
Memory safe is an stupid concept to hide programmer incompetence, there is not such thing as memory safe language, you can have memory leaks even in JS or Java.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072257 >>1072288 >>1072345
>>1072240
I mean yeah, but it's really easy to do in C or C++. I'm not even sure I would call it "programmer incompetence", stuff made by the smartest people I know commonly have memory leaks, and everyone relies on valgrid to save their asses.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072288
>>1072257
Yeah memory leaks are basically guaranteed. There is literally no way to know if you have allocated memory in C. And fuck so called productivity tools. If you need a tool to help you write code then your language is complete dogshit.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072304 >>1072616
>>1072240
Leaks are memory safe though.
Your Cnility is showing.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072310 >>1072320
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072320 >>1072340
>>1072310
>Not just writing everything in Assembly
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072333
assembly is memory safe
C/C++ BTFO once again
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072340
>>1072320
>using assembly instead of working directly with the CPU
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072345
>>1072257
Intelligence != rigor.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072616 >>1072627
>>1072304
>allocate memory
>allocation fails
>crash hard
>entire rest of OS has long since burned to the ground due to memory starvation and lots of direct I/O to slow disks due to cache starvation
>at least it's memory safe
leaks aren't writing to the wrong memory, but they're still bad m8.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072624 >>1072627 >>1072685 >>1072688 >>1073529
>>1062254 (OP)
I wonder how many people here can actually program. If less than 30%, then we are even worse than half chan /g/.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072627
>>1072616
>moving the goalposts
>>1072624
About 98℅ are LARPers
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072685
>>1072624
10 READ SICP
20 GOTO 10
Checkmate, atheist
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072688 >>1072716
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072716 >>1072722
>>1072688
the source is an average of a couple of unofficial polls on half chan /g/.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072722 >>1072760
>>1072716
>what is self-selection bias
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072760
>>1072722
do you have a better solution as to how to poll people on this topic?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072848 >>1073544
I am coding the RNA in my mitochondria to make me superhuman.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072907 >>1072945
>be me
>doing some shitty project
>let me download other projects to see if I'm compatible
>seg fault, seg fault, no features, seg fault, need to write a giant config file to test it out, seg fault
I'm just going to say it works and let people open issues. It's the open sores way.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072945 >>1072988
>>1072907
>be me
Fuck off back to cuckchan.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1072988
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073529
>>1072624
>can actually program
What do you have to be able to do to fit in this category?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073544
>>1072848
>I am coding the RNA in my mitochondria to make me superhuman.
How the fuck are you coding the RNA in mitochondria? It would be better to modify mDNA to make changes permanent? Be careful not to start apoptosis.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073566 >>1073581
>>1062254 (OP)
I have been toying with MIPS recently and I wonder: why isn't there an assembler with type annotations?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073581 >>1073781
>>1073566
>assembly
>types
Nigger, it's just bits. There are no types. Use a high level language if you want types.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073584
>>1062254 (OP)
bash, from Gnu Bash Reference Manual
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073726 >>1074654
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073776 >>1073809 >>1073818 >>1073828 >>1074017
Experiment: compare the runtime speed of calculating the 40th Fibonacci number.
'C:'
#include <stdio.h>
int fibonacci(int term);
int main(){
int t;
t = 40;
printf("%d ", fibonacci(t));
return 0;
}
int fibonacci(int term){
if(term < 2)
return term;
return fibonacci(term - 1) + fibonacci(term - 2);
}
'Rust:'
fn main() {
println!("{}",fib(40));
}
fn fib(n: u32) -> u32 {
if n < 2 {
return n;
}
return fib(n-1) + fib(n-2);
}
'Go:'
package main
import "fmt"
func main() {
fmt.Println(fib(40))
}
func fib(n int) int {
if n < 2 {
return n
}
return fib(n-1) + fib(n-2)
}
Results using time:
C: 0.585s (gcc fib.c)
Rust: 0.500s (rustc -O fib.rs)
Go: 0.584s (go build fib.go)
Filesize:
C: 20,776
Rust: 1,689,424
Go: 1,997,479
I found that strange that a Rust binary would be just as large as Go, given that Go has a runtime with a GC included in its overhead.
Here's what I get from strings {binary file} | wc
| lines | words | chars |
C: 113 | 174 | 22122
Rust: 7,581 | 9,485 | 236,679
Go: 26,308 | 33,290 | 302,173
Rust has some odd ones like:
modeAccessErrorcannot access a TLS value during or after it is destroyeduse of std::thread::current() is not possible after the thread's local data has been destroyedsrc/libstd/thread/mod.rsinconsistent park state
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073781
>>1073581
Dumb as hell. bits, bytes, words, dwords, qwords, etc.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073809 >>1073851
>>1073776
That's a bad comparison, because you're building an optimized Rust binary while you don't do the same for C. Try to use `gcc -O2 fib.c`, then you'll see that the C version should be faster.
>I found that strange that a Rust binary would be just as large as Go, given that Go has a runtime with a GC included in its overhead.
They currently don't remove many symbols from the binary. You can strip the binary with `strip fib` then it should be much much smaller.
https://github.com/rust-lang/cargo/issues/4122
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073818 >>1073851
>>1073776
>microbenchmark
>doesn't optimize C code
>why are statically linked binaries bigger than dynamically linked ones
wew
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073828 >>1073847 >>1073851
>>1073776
How big of a botnet computer do you need to build a Rust compiler? How about Go? ANSI C?
The speed, I don't care about.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073847
>>1073828
>How big of a botnet computer do you need to build
clang: super massive
rustc: massive
gcc: slightly massive
go: big
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073851 >>1073860 >>1073913
>>1073809
gcc -O1 fib.c
time: 0.415
size: 20776 (same as without optimization)
gcc -O2 fib.c
time: 0.294
size: 20776
gcc -O3 fib.c
time: 0.276
size: 20776
Lang | Pre-strip | Post-Strip | % reduction
C | 20,776 | 14,440 | 30%
Rust | 1,689,424 | 194,984 | 88%
Go | 1,997,479 | 1,407,816 | 30%
The output of strings on the Rust binary actually kept most of the error messages. I think some are interesting.
unrecognized DWARF form
signed LEB128 overflows uint64_t
thread panicked while panicking. aborting.
>>1073828
My toolchain in .rustup is about 1.6GB. Project folders will rapidly grow once you start building. A hello-world actix-web server was about 0.5GB for me.
/usr/local/go is 323MB, and most of that is the std library.
>>1073818
>wew
You sure told me.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073860 >>1073869
>>1073851
>You sure told me.
I did. Either link the C one statically or link the Rust and Go ones dynamically.
Your comparison makes absolutely no sense otherwise.
Also if you want the error message gone build with "-C panic=abort"
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073869 >>1073874
>>1073860
>comparing default behavior makes absolutely no sense.
Ok. I think you just parroted a stale meme and made arbitrary demands because you're obnoxious.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073870
negative IQ
Have fun being a nodev LARPer whose only competence is comparing sizes of statically linked and dynamically linked binaries.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073874 >>1073912
>>1073869
>Doing apples to apples comparison and not being a stupid faggot using the default behavior of compilers developed decades apart is 'parroting a stale meme'
How does /tech/ attract such retarded posters?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073912 >>1073927
>>1073874
So nobody should ever acknowledge a difference in execution time between a python program and a C program, right? It wouldn't be "apples to apples" unless in the C program, you wrote a python interpreter which THEN executed the same program. Really, you should only make comparisons of things to themselves only, as a rule for life in general.
When is the last time you statically linked your C program? When is the last time you dynamically linked a Go binary? Oh, right. Never.
'parroting a stale meme' (sic [for single quotes]) is the expression "wew," you oldfag, you. I bet you remember the exodus and still have your gray suit and afro wig just in case you need to close the pool.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073913 >>1073998 >>1074001
>>1073851
How about memory? I think that's the biggest hurdle. I can easily add terrabytes of disk, but my ARM SBC has only 2 GB RAM.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073927
>>1073912
>hurr durr my retarded comparison isn't retarded :'(
kill yourself. btw since you're such a fucking faggot I did it myself:
Lang | Pre-strip | Post-Strip
C | 8672 | 6304
Rust | 9224 | 6192
C got BTFO once again.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1073998 >>1074001
>>1073913
I got this output from "command time" for the Maxresident variable for each fibonacci program. Take it with a grain of salt.
C (-O3): 1428 KB
Rust: 1832 KB
Go: 5448 KB
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074001
>>1073998
>>1073913
Also, for perspective, the same program in Guile scheme, Python and Perl6
Lang | Time | Mem
Guile | 6.492s | 24,744 KB
Python 3 | 24.133s | 8,524 KB
Perl 6 | 170.012s | 90,928 KB
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074017 >>1074690
>>1073776
| Speed | Lang | Runtime | Max RSS | Size |
|--------+---------+------------+---------+--------------|
| 1x | C | 357.280 ms | 1.4 MB | 15K |
| 1.019x | Mercury | 363.752 ms | 5.8 MB | 37K / 2.8 MB |
| Lang | Compilation |
|---------+----------------------------------------------------------------|
| C | gcc -O3 -o fibc fibc.c |
| Mercury | mmc -s hlc.gc.pregen -O4 --intermodule-optimization --make fib |
- Mercury's 37K binary requires Mercury-specific shared libraries.
The 2.8 MB binary has those libs statically linked (with
--mercury-linkage static), and is as portable as the shared C
binary.
:- module fib.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module int, list, string.
main(!IO) :-
io.format("fib(40) = %d\n", [i(fib(40))], !IO).
:- func fib(int) = int.
fib(N) = R :-
(
N < 2 -> R = N;
R = fib(N - 1) + fib(N - 2)
).
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074654
>>1073726
Halfchan's /g/ makes lots of good ones.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074690 >>1074710
>>1074017
add one line:
:- pragma memo(fib/1).
and the Mercury runtime drops to 5% of the C runtime.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074710 >>1074757
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074731 >>1074734 >>1074735 >>1074736 >>1074746 >>1074757 >>1074758 >>1074902
I am apparently a retarded larper. I can't get this simple stack implementation to stop segfaulting. I'm working on a little stack based language, but there's not point if I can't get a fucking stack to work. No, this is not homework.
#include <stdio.h>
typedef struct stack{
int type;
char *value;
struct stack *next;
}stack;
void push(stack *newTop, stack *theStack){
newTop->next = theStack;
theStack = newTop;
}
void pop(stack *toPop, stack* popped){
stack *newTop;
popped = toPop;
toPop = toPop->next;
}
int main(int argc, char **argv){
char *input;
stack *mainStack;
stack *ceruleanBlue;
char farts[5] = "farts";
mainStack = NULL;
ceruleanBlue = (stack*)malloc(sizeof(stack));
ceruleanBlue->type = 3;
ceruleanBlue->value = farts;
//push segfaults
push(ceruleanBlue, mainStack);
puts(mainStack->value);
printf("%i\n", mainStack->type);
pop(mainStack, ceruleanBlue);
free(ceruleanBlue);
free(mainStack);
puts("Goodbye! I'll miss you...");
return 0;
}
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074734 >>1074735 >>1074753 >>1074756
>>1074731
12c12
< *theStack = *newTop;
---
> theStack = newTop;
28c28
< mainStack = malloc(sizeof(stack));
---
> mainStack = NULL;
You might want to watch assigning char* to a char array for later. Lots of funny bugs if you change scope.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074735 >>1074739 >>1074753
>>1074731
First off don't listen to >>1074734
The reason why it is segfaulting is that you are only changing the value of theSack on line 13 in the scope of the function. What you will need to do is actually pass in a double pointer so that you'll be able to set that point to a value. Pulling this off does require you to be a 2 star programmer, so I would recommend trying to find a better way to do this. You would also have to use double pointer for both the arguments into the pop function. Another three mistakes in your program are not including stdlib, only having your "farts" array being 5 long (it needs to be 6 to hold the null terminator), and you are freeing the same and you are doing a double free (which can lead to vulnerabilities) at the end of your function.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074736 >>1074902
>>1074731
There are at least 5 bugs in this. I can make you a corrected version when I get back from work today in about 10h. Have to go now...
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074739
>>1074735
all this autism because of a malloc. lmao
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074746 >>1074749
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074749
>>1074746
lol no
I'd consider Ada, though.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074750 >>1074751 >>1074756 >>1074775
So I rewrote my push and pop functions to be this:
stack* pop(stack *toPop, stack* popped){
popped->type = toPop->type;
popped->value = toPop->value;
toPop = toPop->next;
return toPop;
}
stack* push(stack *newTop, stack *theStack){
newTop->next = theStack;
theStack = newTop;
return theStack;
}
Pushing seems to work fine now. Pop in still being weird. Do I need to make grabber a double pointer?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074751
>>1074750
s/grabber/popped
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074753 >>1074756
>>1074735
I think >>1074734 is right. I was getting a weird bug that went away when I switched from a char array to a char pointer.
Everything seems to be working now.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074756 >>1074775
>>1074753
>I think >>1074734 is right
He's only right if you wish to copy the entire contents of the struct. My way will just copy a single pointer. If you don't want to unnecessarily duplicate data, do it my way.
>>1074750
Don't copy the structure by value. Like I said above you are needlessly duplicating data.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074757
>>1074710
In other words, the C solution takes 20 times as long to finish as the Mercury solution. You could do the same thing in C, obviously. Make sure you keep track of how long that takes you though.
>>1074731
add pre/post assertions, like in a contract language (like Ada). That's two assertions: one on function entry, and one on function exit, to say that really basic stuff about your data structure holds. This stuff doesn't need to be fast; you can even reuse stack functions in it. Run the program with assertions on.
If that fails (it won't), run your program through gdb. You can step through the program and print out stuff as you go, or you can run right into the segfault and then check the stack. Learn to debug.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074758 >>1074761
>>1074731
also:
#include <stdio.h>
typedef struct stack{
int type;
char *value;
struct stack *next;
}stack;
void push(stack *newTop, stack *theStack){
newTop->next = theStack;
// what about ->type ? what about ->value ?
theStack = newTop; // what do you think you're doing here?
// this doen't change memory. It changes
// what 'theStack' means within this function.
// this assignment is meaningless.
}
void pop(stack *toPop, stack* popped){
stack *newTop; // you're removing an element from the stack. So WTF is this for?
popped = toPop; // you've now assigned one parameter to the other. What was the point of the first parameter?
toPop = toPop->next; // see above with 'theStack = newTop'. This assignment is of no consequence whatsoever.
}
int main(int argc, char **argv){
char *input;
stack *mainStack;
stack *ceruleanBlue;
char farts[5] = "farts"; // C strings end in a NUL byte, '\0'.
// a 5-element array and the five letters of "farts" leaves
// you no more space for the NUL byte. treating this farts as a string
// (i.e., a simple puts(farts);) is an error.
// why do you want to specify the size anyway?
// the string literal is right there!
// an explicit size has no purpose but to permit this class of error.
// (or to have a larger buffer than the initial string)
mainStack = NULL;
ceruleanBlue = (stack*)malloc(sizeof(stack)); // don't cast malloc()'s return. This isn't C++
// malloc can fail.
// try not repeating yourself with the parameter to malloc.
ceruleanBlue->type = 3;
ceruleanBlue->value = farts;
//push segfaults
push(ceruleanBlue, mainStack); // this does nothing but assign ceruleanBlue->next to NULL.
puts(mainStack->value); // this dereferences NULL
printf("%i\n", mainStack->type); // this dereferences NULL
pop(mainStack, ceruleanBlue); // this dereferences NULL (at toPop->next)
free(ceruleanBlue); // this is fine
free(mainStack); // this is a no-op. don't do this anyway. Write a free_stack.
puts("Goodbye! I'll miss you...");
return 0;
}
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074761 >>1074762 >>1074765 >>1074769
>>1074758
>// this is a no-op. don't do this anyway.
Wrong, it invokes undefined behavior that can lead to vulnerabilities.
<Otherwise, or if free(ptr) has already been called before, undefined behavior occurs
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074762
>>1074761
>it invokes undefined behavior
LOL
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074765 >>1074766
>>1074761
I mention that later, at the third "this dereferences NULL". what a silly language.
This is also silly for many reasons:
:- module stack.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module univ, list, string, exception.
:- type stack_types
---> string
; int.
% 'type' is a reserved word
:- type stack
---> empty
; stack(
stype :: stack_types,
value :: univ,
next :: stack
).
:- pred push(stack_types::in, univ::in, stack::in, stack::out) is det.
push(Type, X, St, stack(Type, X, St)).
:- pred pop_string(string::out, stack::in, stack::out) is det.
pop_string(Str, stack(string, X, St), St) :- det_univ_to_type(X, Str).
pop_string(_, empty, _) :- throw(software_error("stack underflow")).
pop_string(_, stack(int, _, _), _) :- throw(software_error("type error in pop()")).
:- pred drop(stack::in, stack::out) is det.
drop(stack(_, _, St), St).
drop(empty, _) :- throw(software_error("stack underflow")).
main(!IO) :-
some [!S] (
push(int, univ(666), empty, !:S),
push(string, univ("farts"), !S),
push(int, univ(101), !S),
io.print(!.S, !IO), io.nl(!IO),
% verbose without pop_int
(
!.S = stack(_, X, _)
->
univ.det_univ_to_type(X, N),
io.format("top of stack: %d\n", [i(N)], !IO)
;
true
),
drop(!S),
pop_string(Str, !S),
io.format("popped string: %s\n", [s(Str)], !IO),
% deliberate type error in stack
pop_string(Str2, !.S, _)
).
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074766
>>1074765
output:
$ ./stack
stack(int, univ_cons(101), stack(string, univ_cons("farts"), stack(int, univ_cons(666), empty)))
top of stack: 101
popped string: farts
Uncaught Mercury exception:
Software Error: type error in pop()
Stack dump follows:
0 pred exception.throw/1-0 (erroneous) (exception.m:298)
1 pred stack.pop_string/3-0 (det) (stack.m:27)
2 pred stack.main/2-0 (det) (stack.m:57)
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074769
>>1074761
oh I thought you were talking about "toPop = toPop->next;" somehow. you're talking about the second free?
>man 3 free
The free() function frees the memory space pointed to by ptr, which must have been returned by a previous
call to malloc(), calloc(), or realloc(). Otherwise, or if free(ptr) has already been called before, unde‐
fined behavior occurs. If ptr is NULL, no operation is performed.
it's a no-op and invokes no undefined behavior.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074775 >>1074837
>>1074750
Yeah that push will work.
Since you want to change the actual address of toPop inside the function it will need to be a double pointer.
stack * pop(stack **toPop){
stack * popped = *toPop;
*toPop = (*toPop)->next;
return popped;
}
>>1074756
>copy the entire contents
Why? Because of that malloc to solve the final free?
Anyway anon already solved that he can just do
stack *mainStack = push(ceruleanBlue, NULL);
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074837
>>1074775
In case anyone was wondering why my brainlet ass was using ceruleanBlue as a variable name, see webm related.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074861 >>1074862
How do i find the energy to program after a 9 hour work day?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074862 >>1074863
>>1074861
dial "porn and games" from 11 down to 7. Use the freed energy to program instead.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074863
>>1074862
I already have them down to less than that to be honest. I guess Im speaking more about motivation than anything.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074902 >>1074958
>>1074736
>>1074731
Ok, I'm back from work. Sorry, but your code wasn't really fixable :) I wrote it a little different. Hope it helps...
#include <stdio.h> //for printf()
#include <stdlib.h> //for malloc()/free()
#include <string.h> //strlen()
typedef struct stack{
int type;
char *value;
struct stack *next;
}stack;
int push(int type, char *value, void **theStack){
stack *newItem;
if (!(value && theStack)) { //type=0 is allowed
printf("ERROR: invalid params\n");
return -1;
}
if (!(newItem = (stack *)malloc(sizeof(stack)))) {
printf("ERROR: not enough memory\n");
return -1;
}
if (!(newItem->value = (char *)malloc(strlen(value)+1))) { //alloc space for the string, +1 for \0 byte
printf("ERROR: not enough memory\n");
free(newItem);
return -1;
}
newItem->type = type;
strcpy(newItem->value, value); //make a copy of the string, not just a reference
newItem->next = (struct stack *)*theStack; //remeber current stack-top
*theStack = (void *)newItem; //assign new item to stack-top
return 0; //no error
}
int pop(int *type, char *value, void **theStack){
stack *curItem, *nextItem;
if (!(type && value && theStack)) {
printf("ERROR: invalid params\n");
return -1;
}
if (!(*theStack)) {
printf("ERROR: stack empty\n");
return -1;
}
curItem = (struct stack *)*theStack; //reference the current item on stack-top
nextItem = curItem->next; //save next position, cos free() kills the memory region
*type = curItem->type;
strcpy(value, curItem->value);
free(curItem->value); //free string
free(curItem);
*theStack = (void *)nextItem; //assign new/next top to stack (can be NULL)
return 0; //no error
}
int main(int argc, char **argv){
void *mainStack = NULL; //use void * to keep the stack private and init with NULL==empty
int outType;
char outValue[32+1]; //reserve maximal 32 chars for the output-value
if (push(3, "farts", &mainStack)) return 1;
if (push(4, "farting", &mainStack)) return 1;
if (push(5, "farted", &mainStack)) return 1;
if (pop(&outType, outValue, &mainStack)) return 1;
printf("%i %s\n", outType, outValue);
if (pop(&outType, outValue, &mainStack)) return 1;
printf("%i %s\n", outType, outValue);
if (pop(&outType, outValue, &mainStack)) return 1;
printf("%i %s\n", outType, outValue);
if (pop(&outType, outValue, &mainStack)) return 1; //produce ERROR: stack empty
printf("%i %s\n", outType, outValue);
puts("Goodbye! I'll miss you...\n");
return 0;
}
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074919 >>1074929 >>1075068
What's the gold standard C++ programming books?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074929
>>1074919
Probably not. But there are good ones no doubt.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1074958
>>1074902
>writing errors to standard output
>casting malloc's return
>always-on runtime checks of parameters
>void instead of struct stack (justified by pretending that C doesn't have an obvious type-safe alternative)
>all this safety shit and you're blindly strcpy()ing in pop()
>saving nextItem instead of just assigning *theStack after assigning curItem (blatantly unnecessary temporaries)
>farts, farting, farted? are you twelve???
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1075000 >>1075004 >>1075064
Sorry for not reading the whole thread, but which language should I learn for strictly back-end web-dev?
I'm planning my next project which will consist of a Single-page application for the front-end (yes javascript, yes i know), and a simple web api back-end.
I know Java and Python, but not any web framework. I've used asp.net for this kind of thing before, but I want to get away from MicroJew. I don't want to use use Java or Python for this thing.
Redpill me on backend webdev in 2019.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1075004
>>1075000
you have three alternatives:
1. pretend you are big tech and chase buzzwords. Eventually you'll accomplish something and it might 'scale' but not without technical know-how you don't have. For all practical purposes you'll have a bloated an expensive and hard to understand version of whatever you might get with the following:
2. pick a framework and use it. Even though HTTP and all the involved techs are dead simple and well documented, people write limited frameworks that do things in quirky ways that you need separate documentation for. This is a safe bet, and depending on the framework you'll have something decent almost immediately.
3. read the HTTP and related RFCs and just use whatever you know well. You can use literally anything for backend dev. I've got Perl, Python, and Nim backends, and write all the web shit myself. It works fine. If you've ever dug into a product that's popular or that you like (wordpress, vichan, whatever), you'll very notice how fucking shitty and ad-hoc they are. The most popular CMS in the world mostly just prints out strings containing HTML. You do not need futurist technology or glowing fads to do webdev.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1075064
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1075068
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1075253
>>1063175
what python book did you use anon?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076017 >>1076018 >>1076021 >>1076057 >>1076068
>reading from stdin to get the input which might be redirected into the program from a file
>works all fine except when there is no redirection into the program, it just hands stupidly waiting for manual input from stdin
How to handle this in C? How to have your program accept redirected input, but not expect manual input when no file is being redirected?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076018
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076021 >>1076023 >>1076057 >>1076068 >>1076092
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076023 >>1076032 >>1076057 >>1076068
>>1076021
So basically isatty() is a function which returns 1 if stdin is empty at runtime and thus attached to the tty the program is running in, and it returns 0 if stdin was fed something from redirection?
What header file needs to be included? Is it even available in Windows compilers? Is it s part of the standard C library?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076032 >>1076068
>>1076023
>What header file? standard C library?
man isatty
^^^
it's a command. You can also search the web for it.
>Windows compilers
no clue.
>returns 1 if stdin is empty
no. it returns 1 if stdin is a tty. It's possible for you to start a program and then quickly type some stuff, and then it be the case that stdin is not empty while stdin is still ''attached to a tty'.
Since you don't want interactive input, you shouldn't care about this case.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076057 >>1076068 >>1076092
>>1076017
How about you change the design of your program?
>>1076021
>man braindamage
The only reason you would ever use isatty is when you don't want to shit up the output if stdout happens to not be a braindamaged not-quite-vt100 emulator.
Fucking UNIX niggers fucked things up real bad. I hope they burn in hell.
>>1076023
>Windows
https://docs.microsoft.com/en-us/windows/console/getconsolemode
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076068 >>1076071
>>1076017
>>1076021
>>1076023
>>1076032
>>1076057
Seeing this chain reminded me of seeing someone use a C FFI in a Common Lisp program in order to use isatty(). You may be interested to know Common Lisp has INTERACTIVE-STREAM-P for this; I think it's a better name, clearly, and communicates the intent better.
Here's some information on it:
http://clhs.lisp.se/Body/f_intera.htm#interactive-stream-p
>Returns true if stream is an interactive stream; otherwise, returns false.
I'll include all of the following:
http://clhs.lisp.se/Body/21_aaac.htm
>An interactive stream is one on which it makes sense to perform interactive querying.
>The precise meaning of an interactive stream is implementation-defined, and may depend on the underlying operating system. Some examples of the things that an implementation might choose to use as identifying characteristics of an interactive stream include:
>* The stream is connected to a person (or equivalent) in such a way that the program can prompt for information and expect to receive different input depending on the prompt.
>* The program is expected to prompt for input and support ``normal input editing''.
>* read-char might wait for the user to type something before returning instead of immediately returning a character or end-of-file.
>The general intent of having some streams be classified as interactive streams is to allow them to be distinguished from streams containing batch (or background or command-file) input. Output to batch streams is typically discarded or saved for later viewing, so interactive queries to such streams might not have the expected effect.
>Terminal I/O might or might not be an interactive stream.
It's not wrong to have a program behave differently if it knows a human can direct it. If a stream is interactive, you may prompt for things you otherwise wouldn't or take other considerations into account; if not, you may avoid this or may stop the program entirely if interactivity is the entire purpose of the program.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076071
>>1076068
>It's not wrong to have a program behave differently if it knows a human can direct it.
Sure. But instead of doing some braindamaged check if stdin is connected to a tty how about telling the program to run in interactive mode?
>shilling LISP
unbased
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076083 >>1076093 >>1076100
What are some good beginner resources to learn opengl and 3d graphics programming in general?
Im an intermediate level C/C++ programmer and everything I come across is either outdated or assumes you already know about graphics apis and how gpus work internally. ty
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076092
>>1076057
>How about you change the design of your program?
Why? I wanted the program to optionally also accept text input from redirection in addition to arguments, the isatty() function from unistd.h which this >>1076021 anon suggested helped to achieve exactly that.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076093
>>1076083
>everything I come across is either outdated or assumes you already know
Speaking of the "late-to-the-party syndrome".
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076100 >>1076106
>>1076083
Honestly? Get down and dirty with the hows and why gpu's work. If you're intermediate with C/++ you should have a basic understanding of assembly and how it translates to machine code, and if you want to git gud with opengl it helps to understand what problem it's solving, and why the problem is hard in the first place.
If you mean more high-level graphical effects, I play around with https://www.shadertoy.com/ when I want to try something quickly.
>>1062254 (OP)
I'm trying to wrap my head around symbolic execution, I've been reading a lot of papers on it. One thing that I keep seeing is that having disjunctions in your constraints makes it hard for the SMT solver to do it's thing, but I don't really understand why this is. I have a pretty good CS background but my mathematics is pretty lacking. Help?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076106
>>1076100
He wants to be spoonfed. Also he's probably a pajeet since I've never heard anyone smart call themselves an "intermediate level at lang X." That seems like some hiring classification for interchangeable pajeet cogs. Sir plan is to utilize the maximum of intermediate programmers with combination of low level programming for 100% success in cheapest price to you."
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076154 >>1076169
anyone have a bunch of self-contained programming tasks that are designed to be used to learn (or reacquaint yourself with) a language?
An obvious answer is RosettaCode but their tasks are mostly really boring. Lots of "here's a random number sequence. Find the nth number.", which doesn't actually exercise many parts of a language.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076161 >>1076162 >>1076165
anybody Zig here? please improve on
const std = @import("std");
pub fn main() !void {
const out = try std.io.getStdOut();
const in = try std.io.getStdIn();
var bytes: [128]u8 = undefined;
try out.write("What is your name? ");
const len = try in.read(&bytes);
try out.write("Hello, ");
try out.write(bytes[0 .. len - 1]);
try out.write(", nice to meet you!\n");
}
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076162 >>1076163 >>1076166
>>1076161
use std::io::{self, Read, Result, Write};
fn main() -> Result<()> {
let mut stdout = io::stdout();
let mut stdin = io::stdin();
let mut string = String::new();
writeln!(stdout, "What is your name? ")?;
stdin.read_to_string(&mut string)?;
writeln!(stdout, "Hello, {}, nice to meet you", string)?;
Ok(())
}
https://play.rust-lang.org/?gist=6362736ad7a498ab67a9097e2d0f93cc
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076163
>>1076162
Nice work! This is obviously much better Zig than that first try. But I've improved it even further:
:- module hello.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module list, string.
main(!IO) :-
io.write_string("What is your name? ", !IO),
io.read_line_as_string(Result, !IO),
(
Result = ok(Line),
chomp(Line) = Name,
io.format("Hello, %s, nice to meet you!\n", [s(Name)], !IO)
;
Result = eof
;
Result = error(_)
).
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076165 >>1076167 >>1076174 >>1076175
>>1076161
Here I fixed it for you
#inlcude <stdio.h>
void main() {
char bytes[128] = {};
printf("What is your name? ");
fgets(bytes, 128, stdin);
printf("Hello, %s, nice to meet you!\n", bytes);
}
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076166 >>1076168
>>1076162
actually this Zig isn't that good.
$ ./hellor
What is your name?
hi
..
.
.
?
ctrl-d
Hello, hi
..
.
.
?
ctrl-d
, nice to meet you
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076167 >>1076170
>>1076165
>no error handling
cnility
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076168
>>1076166
My name contains newlines. Works as intended.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076169 >>1076173
>>1076154
The golden rule is to write an IRC bot.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076170 >>1076173 >>1076174 >>1076175
>>1076167
What do you expect to fail here? This is your brain in rust babygloves.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076173 >>1076180 >>1076316 >>1078004
>>1076169
>IRC braindamage
Write a C interpreter instead. You'll learn about all the braindamage that is C/C++.
>>1076170
http://port70.net/~nsz/c/c11/n1570.html#7.21.6.3
> The printf function returns the number of characters transmitted, or a negative value if an output or encoding error occurred.
http://port70.net/~nsz/c/c11/n1570.html#7.21.7.2
>The fgets function returns s if successful. If end-of-file is encountered and no characters have been read into the array, the contents of the array remain unchanged and a null pointer is returned. If a read error occurs during the operation, the array contents are indeterminate and a null pointer is returned.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076174
>>1076165
>void main
compile with -Wall, anon
you already typo'd the include
>>1076170
$ ./helloc </dev/null
What is your name? Hello, , nice to meet you!
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076175
>>1076165
>>1076170
Also, an emty initializer list is UB.
Get fucked, Cnile.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076180 >>1076182
>>1076173
How about you make a program where being pedantic about securing every useless thing actually matters first.
> if (printf("foo")<0) return;
Wow
You do not need nuclear grade security in your hello world, retard. This is why rustfags are larpers.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076182 >>1076183
>>1076180
>disregards the UB
absolute cnility
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076183 >>1076184
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076184 >>1076188 >>1076194
>>1076183
>i'm cnile
My condolences. Let me help you:
6.7.9 Initialization
Syntax
1
initializer:
assignment-expression
{ initializer-list }
{ initializer-list , }
initializer-list:
designationopt initializer
initializer-list , designationopt initializer
designation:
designator-list =
designator-list:
designator
designator-list designator
designator:
[ constant-expression ]
. identifier
Does the grammar allow the initializer-list to be empty?
Protip: It does not.
What does it mean if you do something which isn't explicitly defined?
http://port70.net/~nsz/c/c11/n1570.html#4
>2 If a shall or shall not requirement that appears outside of a constraint or runtime- constraint is violated, the behavior is undefined. Undefined behavior is otherwise indicated in this International Standard by the words undefined behavior or by the omission of any explicit definition of behavior. There is no difference in emphasis among these three; they all describe behavior that is undefined.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076188 >>1076189
>>1076184
{} is not UB, it initializes the memory as 0s.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076189 >>1076192
>>1076188
Where in the standard is this specified?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076192 >>1076194
>>1076189
It's UB in the sense that "changing your compiler and extensions changes the result". If you want to go there then sure, you're right.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076194 >>1076197
>>1076192
>redefining what UB is and means
The absolute state of Cniles. I literally quoted the standard to you here >>1076184
>Undefined behavior is otherwise indicated in this International Standard [...] by the omission of any explicit definition of behavior.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076197 >>1076199
>>1076194
>only senile people know their own tools and work with them
Ok.
Didn't know deliberate and defined changes are counted as "undefined" as well, I'll admit.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076199 >>1076200
>>1076197
>still being in denial
Damn
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076200 >>1076202
>>1076199
Denial about what? About this pedantic meta ideology?
UB doesn't matter when it's defined as "using the wrong tool causes a problem".
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076202
>>1076200
>UB doesn't matter
LOOOOOOOL
You still haven't shown me where an empty initializer list is specified btw.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076212 >>1076214
>shit better shill rust again
Steve you do this for free now. pozilla will never hire you back you pleb.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076214 >>1076228
>>1076212
Clouflare pays more. Also my GF works there too. Fuck Pozilla.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076228
>>1076214
>shill Rust
>write a book that inspires millions
>get a better job
>get qt gf and have memory-safe sexual experiences. Zero segfaults.
Is there anything Rust can't do?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076316
>>1076173
OK, now more realistically, under what specific circumstances would fgets or even printf actually fail?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076481
>>1071438
Finally some common sense in this thread.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076489
$a = "b";
$b = "a";
echo $a . "\n";
echo $$a . "\n";
echo $$$a . "\n";
echo $$$$a . "\n";
Sometimes you need a good laugh.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076566
Is there a more beautiful programming language?
No anon, it wouldn't be logical.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076802
C is C
C++ is COBOL
Rust is C++
Go is Python
Python is Perl
Perl is APL
Admit it.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076891 >>1076903
Correct my theoretical retardation please, /prog//tech/. When we're talking about parsing websites, programs usually realize functions to do it in the same language they're written. But if you have a need for cross-platform functionality and, for example, include Android, then you'd need to rewrite parsers across several codebases. How feasible would it be to reliably realize the walking of the DOM tree and the extraction of information in a scripting language like Lua? I'm specifically interested in how the conversion from $language's HTML node structure to Lua's table would be done. I think it would impact the performance too much. There's another option of bundling a ready HTML parser module along with the Lua scripts so you're just passing the page response in text. So far I've realized little mockups of retrieval and parsing with Gumbo and cURL (both very portable C libs) bindings to Lua and I was wondering if somebody with more knowledge has some practical advice on it going forward. I'd like to make the parsing itself as independent as possible, so you could simply include it in your program.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1076903 >>1077013
>>1076891
>how can my script run on these different systems :(
0. rewrite the script in a language that does work on the target
1. port the environment for your script to the target platform. You might be able to run your exact same Lua script in Termux on Android. There might be some Lua-on-Android framework that lets you compile proper Android apps including Lua code.
2. option #0 but it's not so painful because the bulk of the work of your script is performed by libraries that are more portable than your script
3. use a transpiling language that compiles, also, to a language that does work on your target.
For example: you write your initial script in ATS and compile it through C, but for Android deployment you compile it to JS and use a JS Android environment. Or you write it in Shen (CL normally/Java on Android). Or you write it in Mercury (C normally/Java on Android). Or you write it in Nim (C normally/JS on Android).
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1077013
>>1076903
>0. rewrite the script in a language that does work on the target
It's what I'm trying to avoid actually.
>There might be some Lua-on-Android framework that lets you compile proper Android apps including Lua code.
You can run Lua code via LuaJ, an implementation of the interpreter in Java as an example. I chose the language specifically because it's very embeddable. My question was more about a correct way of passing a potentially large object (entire web page without parsing or its representation as a tree after parsing) through FFI from target language to Lua.
>option #0 but it's not so painful because the bulk of the work of your script is performed by libraries that are more portable than your script
This is the standard way to do it, but the problem is that web pages change unexpectedly and, while it is easy to update a script even from inside of your own program, updating a library is harder or it requires a full program update.
>use a transpiling language
This is actually an interesting idea, especially with Nim.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1077312 >>1077622
#include "stdio.h"
int main(void) {
int i = 0, x = 0;
char c, s[9];
do {
c = (1484271658 >> (i<<2)) & 0xf;
c = (69 & (1<<i)) ? 13-c : 13+c;
s[i] = 96+c; x += 6*c;
} while(++i < 8);
s[i] = 0;
printf("int %s = %d;\n",s,x);
return 0;
}
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1077622
>>1077312
cute. this is exactly the sort of code that I hate.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1077798 >>1077935
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1077935
>>1077798
reply count's over the bumplimit.
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.
▶ No.1078004
>>1076173
>9
>1484271658
>2
>0xf
>69
>13
>96
>6
>8
Why? Why le magick numberz?
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.