lainchan / λ
The Beginner's General
λx.x · 2023-11-13 21:46
This is the Beginner's General for beginners' questions.
If any of you have a simple question, and a suitable thread doesn't already exist, just post it here and someone will probably try to answer it.
Remember to do some research before asking a question; no one wants to answer a question that a simple search can already resolve
Old thread: >>33828
Pulse · 2023-11-16 15:17
>>72131
>>37494
>>36838
>>37489
I asked the #mingw-w64 channel on OFTC & they suggested some things. It works if I export LDFLAGS="-L/usr/x86_64-w64-mingw32/lib -L/usr/lib/gcc/x86_64-w64-mingw32/10-posix" & remove -lmingw32 & -lgcc from the clang arguments -L/usr/x86_64-w64-mingw32/lib -L/usr/lib/gcc/x86_64-w64-mingw32/10-posix -mwindows -v. I was able to see 'Configure complete!'. Thanks for the help.
Pris · 2023-11-21 13:01
I'm looking for a programming language which i can create the server side application part of a webapp project, but is also versatile enough that it's worth learning because i can use it in the future for all kind of soykaf (for example write system applications for linux and BSD, and soykaf related to cybersecurity, for example use it in penetration testing). I would also prefer if it wouldn't take like 10000 times the resources to do one thing compared to C, and at the same time i would prefer if it wouldn't be C. I also i don't want it to compile to bytecode of a runtine environment like Scala, i want native binaries.
My choice so far fell upon Go, but all my friends (who are successfull programmers) tell me Go is soykaf and retarded and whatnot. They talk soykaf about slices, and the lack of "product types" and another thing i forgot that has to do something with types and set theory. They say Rust is great. But i'm afraid trannys will fuarrrk up Rust in a few years. They fuarrrked up everything they touched so far, so what makes them think Rust will be an exception? Also they say Go is Bondage&Discipline, but Pascal also is and i liked it back then. (Maybe they are right about how it influences one's thinking process and that's why i'm such an underachiever in programming)
Please Lainons, tell me, what i should use and learn, Rust or Go or a third one? Please keep in mind that i'm not the smartest person out there and that programming is not my original field, so making this choice right would save me years of learning. Thanks, dear Lainons.
Vasya Pupkin · 2023-11-21 13:14
>>37728
Did C++ not come to mind? That's what I use for server emulation development. Another popular one is C#, despite the fact that people (in the communities that I'm in that work on bots and server emulation) generally agree that the C++ emulators work way better than the C# servers, C# is just easier to work with. So, there's two suggestions.
drop · 2023-11-21 13:20
>>37728
Go takes like 2 days to learn so you may as well try it out. My vote goes to Go, as someone who has gone partway though the Rust book, implemented a client-server connect 4 with Rust, implemented some solutions for Advent of Code in Rust too.
XERXES · 2023-11-21 14:37
>>37728
Go is fine. Past iterations of the garbage collector weren't very performant, but that's fixed, and it used to not have generics, but it does now. Those were the two most painful issues. What are your friends' issues with it in more detail?
Rust is great but it will take longer to learn. Don't worry about the "Rust is a tranny language" meme.
For pentesting, go is probably better because it's quicker to write small tools in and if you're doing anything fuarrrky to trigger an exploit, you won't have to fight with Rust's memory safety rules (although if you're writing code like that, C is a better choice).
I side with >>37730. Go is so simple and easy to learn that you may as well learn it. And you can always learn more languages later.
Cereal Killer · 2023-11-21 14:45
>>37729
>>37730
>>37731
Thanks for the reply Lainons, you convinced me to continue with Go.
>>37729
C++ didn't come into mind because i thought "Rust is everything C++ should be", or some people say that at least.
>>37731
Maybe my friends didn't heard about generics being part of it already, and argued against a past state of the language. They tend to be a bit autistic like we all do.
Chani · 2023-11-21 17:34
>>37732
>C++ didn't come into mind because i thought "Rust is everything C++ should be", or some people say that at least.
I wouldn't really pay much mind to people who proselytize, Lainon.
Kay · 2023-11-22 09:39
>>37731
>What are your friends' issues with it in more detail?
I am >>37730 and I thought I might add to the discussion by saying that I hate the idea of default/zero values in Go, as well as the omission of null safety and nullable types.
cond · 2023-11-22 13:36
How important things like clean code, clean architecture and design patterns are to a software development job? I mean, it feels like most of those concepts are only suitable for OOP and changing paradigm would make almost all of them useless. I'm struggling to choose what I should focus on my studies, the concepts presented before or cs foundations and math. I've been working as a developer for 3 years now.
Agent Smith · 2023-11-22 15:32
>>37736
>clean code
https://www.computerenhance.com/p/clean-code-horrible-performance
https://www.youtube.com/watch?v=tD5NrevFtbU
>design patterns
https://www.quora.com/What-design-patterns-did-Linus-Torvalds-use-when-writing-Git/answer/Gerry-Hayes-4
藤原純一 · 2023-11-23 14:26
>>37738
Shoutouts to people who substitute in a made up they want to reply to for the one that's actually there.
Shogun · 2023-11-23 15:38
>>37738
The dichotomy between clean and performant code is, much of the time, a false one. Clean code can be very fast, and when messy code is necessary you can always paper over it with an abstraction (provided your language lets you do that; sorry if you're stuck with C).
array · 2023-11-24 11:59
>>37738
That guy's definition of "clean code" is a very specific type of object-oriented code that yes is like kicking dead whales down the beach, but that's less clean code being bad for performance and more object-oriented code being bad generally, not just for performance.
Clean code, in the sense of "code that's easy to read and easy to maintain" is almost always more than performant enough for your needs, even on older, weaker hardware. Sure it might not run as fast as something that's been autistically micro-optimized, but excluding some very specific edge cases, that doesn't matter.
That's not to say that you shouldn't be trying to write performant code; you should always be thinking about efficiency, even in very high-level languages like Prolog and Lisp. But it shouldn't be at the cost of your code becoming unreadable nonsense.
Also, a good programming language is one that lets you write performant and readable code at whatever level of abstraction it targets. Most C-family languages are fuarrrking awful at this. And unfortunately there's a large number of people (including the guy you linked) who think that C and its descendents are where the world of computer science begins and ends, so they never truly discover the extent to which man is shaped by his tools.
Arisu Mizuki · 2023-11-25 07:30
>>37736
>How important things like clean code, clean architecture and design patterns are to a software development job?
The Clean Code book and other similar books are memes. OOP design patterns are also mostly a meme but you need to know them if you write in OOP language because you may need to use a design patter from time to time (but if you aren't 100% sure that you need or should use a design pattern, then you shouldn't use one). Read Head First Design Patterns or Design Patterns: Elements of Reusable Object-Oriented Software by Helm et al.
>>37742
>"clean code", in the sense of "code that's easy to read and easy to maintain" is almost always more than performant enough for your needs, even on older, weaker hardware.
This!!
Aristóteles Amadópulus · 2023-11-25 09:43
>>37742
>That guy's definition of "clean code" is a very specific type of object-oriented code
i think they're referring to robert c. martin's definition of "clean code" which like you said is horrible outdated oop crap, but it's also the thing most people are referring to when they use the phrase, because martin wrote a famous book about it. it may be a situation where proponents of "clean code" use a broader definition, but opponents are almost always referring to uncle bob specifically.
roll · 2023-11-25 11:14
>>37745
I wish they would stop saying things like "clean code is inefficient", because a beginner is going to take it literally and think "readable, maintainable code performs poorly, so I'm gonna have to write spaghetti if I want to be a good programmer", which is most definitely not the case.
cond · 2023-11-25 20:21
>>37746
Easiest way to counter this is to teach them "premature optimization is the root of all evils" and show them how to use a profiler.
Wintermute · 2023-11-25 23:44
>>37742
>>37741
It's most important to write code so that the compiler can optimize it, and even lower level than that, it's important to write code so that the microarchitecture can execute it efficiently. Basically it's important to remember that your code is eventually going to execute on a real machine But that's not against the principle of writing "clean code" at all.
There's also the matter that if you're at the point of going in with a profiler or looking at the generated assembly, you better use a literate programming style so that you can come back to it the next day and know what the fuarrrk you were doing.
Donna Hawthorne · 2023-11-26 11:26
Is K&R still worthwhile to read for an introduction to C or is it too outdated? A lot of the example programs, even the simplest of them, don't seem to behave as they were intended to, at least when compiling them with gcc -std=c90 .
Tank · 2023-11-26 12:08
The bigger problem is there are no reward incentives and punishment disincentives to write efficient code in the ponzi scheme known as the software industry. Bloat and abstract all you want, just as long as the feature that your manager, customers or investors requested is implemented, and game the promotion system.
https://youtu.be/yD2JaAnMMo0
Vasya Pupkin · 2023-11-26 12:26
>>37752
>The bigger problem is there are no reward incentives and punishment disincentives to write efficient code
because efficient code doesn't matter to the end user 99% of the time. The other 1% of the time, you write maintainable code first, then profile it to see where the hotspots actually are instead of prematurely obsessing with efficiency.
Apoc · 2023-11-26 13:15
>>37753
This is assuming you've already used efficient algorithms in the first place. No amount of optimization will save an algorithm that runs in exponential time.
William Holtzer · 2023-11-26 16:34
>>37754
Doesn't swapping to a different algorithm count as optimization? Exponential time could be fine if N is always going to be small in practice.
Iverson · 2023-11-27 07:37
>>37751
>Is K&R still worthwhile to read for an introduction to C or is it too outdated?
No, K&R is outdated and it's not the best book for learning C anymore.
K&R is great for the example programs and exercises (and writing style is great). The best book for actually learning C is C Programming: A Modern Approach , 2nd edition. Also, use something like splint or cppcheck (it supports also C in addition to C++ and it has a GUI).
>A lot of the example programs, even the simplest of them, don't seem to behave as they were intended to, at least when compiling them with gcc -std=c90 .
Try using -std=c99 . IIRC, K&R (more specifically the 2nd edition) was written for (what came to be known as) C89.
Also, Re. compiler flags: make sure to always enable -Wall and -Wextra (and maybe even use -pedantic while you are learning C). You should eventually learn to use makefiles but you can also make a simple compile_my_code.sh script.
Also, FYI, if you want to use clang's scan-build command, you need to write a makefile and you need to use CC variable for defining the C compiler (either gcc or clang).
Anyways, here is a simple example makefile:
# also, see: https://nullprogram.com/blog/2017/08/20/
CC = gcc
# Release build CFLAGS:
#CFLAGS = -std=c99 -Wall -Wextra -O2 -march=native -fcf-protection -fstack-protector-all -fstack-clash-protection
# Debug CFLAGS:
CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wformat=2 -fverbose-asm -masm=intel -Og -march=native -ggdb -g3
# This is for using external libraries (ex.: the standard math library):
LDLIBS = -lm
all: test_prog.exe
# test_prog.exe target depends on "test_prog.o".
test_prog.exe: test_prog.o
$(CC) $(CFLAGS) $(LDFLAGS) -o test_prog.exe test_prog.o $(LDLIBS)
# test_prog.o depends on files test_prog.c common.h.
test_prog.o: test_prog.c common.h
$(CC) -c $(CFLAGS) test_prog.c
clean:
rm --interactive *.o
rm --interactive test_prog.exe
# NOTE: each step in a "recipe" must begin with a tab char!
# So, you need to replace 4 spaces with 1 tab.
DEBUG-CONTENTS · 2023-11-27 12:16
>>37755
>Doesn't swapping to a different algorithm count as optimization?
No, optimization means making your code compute the same thing more efficiently. Using a different algorithm can mean something as grandiose as completely changing the core architecture.
>Exponential time could be fine if N is always going to be small in practice.
Sure, but if N is ever even 1 or 2 units bigger than the size you tested with people will go "why the fuarrrk is this code so slow?"
protected · 2023-11-27 15:45
>>37757
>No, optimization means making your code compute the same thing more efficiently.
Different algorithms can produce the same outputs. Seems like it would normally qualify as optimization by that definition. If the reason for exponential time is that you're nesting loops or something there's probably a drop in replacement you could use if it becomes enough of a problem to bother.
If the issue is that the overall design of a larger system is inherently inefficient, then yeah maybe that would be better to think through to begin with and be beyond the scope of "optimization". Can you think of any examples of that though?
Hououin Kyouma · 2023-11-27 19:30
>>37758
>Different algorithms can produce the same outputs
yes, but that doesn't mean they're doing the same thing.
The level at which you like to view "doing the same thing" at of courses changes what this means. If by "do the same thing" you mean that they have the same input and output then sure, you can rewrite a whole program to optimize it. If you mean that the logical structure of the program is the same and you've just tweaked it here and there so that the compiler produces more efficient machine code that performs the same high-level steps, that is what I imagine optimization as. On an even lower level, technically that machine code will perform differently depending on the specific CPU microarchitecture, the system it's running in, the specific loading and environmental conditions at the time, etc., and sometimes it can even be worth trying to optimize on that level too.
>Can you think of any examples of that though?
Yes, mostly in networked algorithms. It is very easy to design a distributed system that is very slow or locks up irrecoverably, for instance.
Another, smaller-scale example: suppose you have a matrix A and a vector b, and you want to find a vector x so that A*x = b. You could solve it by computing the inverse A^-1 and then returning A^-1*b, or by doing a QR factorization A = Q*R and using back-substitution to find x so that R*x = Q^t*b.
There is no amount of optimization that will make computing A^-1 and then multiplying by b faster than doing a QR factorization, except MAYBE in the 2x2 case. It also won't produce the same output due to floating-point errors (the QR output is vastly more accurate).
Unspecified · 2023-11-27 23:48
>>37760
>that is what I imagine optimization as
I think it's reasonable to assume that when people are talking about premature optimization in a general sense, they may mean it higher level though. And anyway looking back at things it seems like the point didn't hinge on "optimization" to begin with.
>Yes, mostly in networked algorithms.
This makes sense
>There is no amount of optimization that will make computing A^-1 and then multiplying by b faster than doing a QR factorization,
It would probably be fine to implement the more efficient algorithm later if needed, unless there's some specific reason it is important for the output to be deterministic/backwards compatible in which case yeah get it right the first time.
Nobody special · 2023-11-28 02:16
Noob needs help. I have a Go-application I want to host on my server and a Nginx-deployment (currently only showing the template).
How do I deploy the Go-application on my server? What do I need to setup? What should I change in Nginx?
All guides I found are assuming things that don't apply in my case or start from scratch. I just want to host my app and make it accessible from the internet.
Batou · 2023-11-28 06:35
>>37763
You don't even necessarily need nginx if all you have is a Go application. Make sure port 80 (the port for HTTP) is open on your server's network, and then make sure you are using go's inbuilt http server, so you should have something along the lines of http.ListenAndServe(":80", nil) in your application. Then just run the application.
"Opening the port 80 on your network" tells the router to forward http requests sent to it to your server.
Making go "listen on port 80" tells the server to forward http requests sent to it to your running go application.
Essentially your go code contains the required logic for taking http requests and producing responses, and all this futzing around with networking/addresses/ports is just so that requests get routed by your network, to your server, to your go application, so that the logic can be run.
If you insist on using nginx here is a nice guide (I find digitalocean tutorials to be pretty good): https://www.digitalocean.com/community/tutorials/how-to-deploy-a-go-web-application-using-nginx-on-ubuntu-18-04
The role of nginx is just to forward requests on port 80 to localhost:9990, since the go application is listening on port 9990 in that tutorial.
Faye Valentine · 2023-11-30 11:47
>>37764
Thank you for your help. I have a better understanding of what to do, now it's about getting there.
I put it into a container and it works fine on my local box, now I just need to figure out how to make Go understand TLS and take ahold of my certificates.
At the very least, I got to a warning rather than 404 so some progress was made.
nil · 2023-11-30 14:07
>>37771
good job lain
if you give up with getting SSL to work, maybe keep trying and look for online resources to help you (specifically those that explain what SSL even is and how it works on a technical level)
you can also use caddy if you really give up, it worked fine for me and I didn't have to do any ssl setup at all
and why do you need ssl anyways? what is your app?
Joe Bloggs · 2023-11-30 15:45
>>37650
What are some rights of passages of programmer
Making a bootloader?
Whats the ultimate acheivement ?
Lain Iwakura · 2023-11-30 17:33
>>37773
>What are some rights of passages of programmer
For me, the big one is writing code that actually does something and serves a purpose, even if it's a minor one, as opposed to finding novel ways to write a program that prints text to the terminal and then immediately closes. That's the cutoff point where you go from someone messing around in an IDE to an actual programmer.
>Whats the ultimate acheivement ?
Writing a fully-featured cross-platform operating system on your own. Off the top of my head I can't think of anyone who's actually accomplished this task.
The Phantom Phreak · 2023-11-30 20:53
>>37773
I'll throw "running into a bug or performance issue in a 3rd party dependency you're using, then fixing it," as a rite of passage.
I agree with >>37775 too.
Just another Random Lainon · 2023-12-01 14:13
What are some good lectures on general, must-know CS topics to watch for a total beginner? I finished the old SICP ones a month or so ago and found the dynamic refreshing in contrast to reading the book and solving the problems, which I also did partially because the lectures themselves were that galvanizing in parts. Just looking for things to watch throughout the incoming year while I keep working on learning CPP/Rust and fuarrrking around making things.
Pris · 2023-12-08 09:14
>>37780
You may find helpful the list from https://teachyourselfcs.com/
It covers plentyful of topics with some general recommendations consisting of both books and lectures
Hacker · 2023-12-10 05:47
>>37773
I think writing a bootloader is only worth it if you are interested in that sort of thing, even then, it's a lot of just reading how BIOS and the CPU works and complying with that, there's no much thinking or architecture to be done there.
I would say writing a medium-sized project (for a single person) in your area of interest: if you are into gamedev a simple game but with a bunch of features, or maybe a simple graphics engine. If you are a webdev then a forum with a frontend, backend, database, etc. If you are into osdev it could be a simple kernel with a command-line and being able to launch programs.
KuriGohan and Kamehameha · 2023-12-18 16:58
Lains, I'm simply lost into this world of programming. I don't know where to begin, nor the language which I should choose first. I found myself in a difficult situation of unemployment. I know I could do a 6 month bootcamp on a random website, but I really don't want to be a mediocre programmer. I suck a bit at math, but it's not something critical. Any resources, books, indications or anything will be highly appreciated.
Terzibashjian · 2023-12-18 17:40
>>37970
Just start with minecraft
KuriGohan and Kamehameha · 2023-12-18 18:17
>>37971
I know I can make logic gates with redstone but...
Nobody important · 2023-12-18 22:12
>>37970
Lisp is a great place for a beginner to start. I recall a few researchers have actually found people with little programming experience starting on their first language can actually learn lisp faster than veteran programers can (presumably after adjusting for how much they already know). Either way, Lisp's a great language that's both straightforward and not needlessly complicated for the beginner and has a lot of headroom for advanced techniques other languages struggle to integrate well as you skill up. One of Lisp's best features is how transparent it is to the underlying principles of Computer Science, so you don't need to worry nearly as much as other languages about if you're wasting time learning the wrong thing, since more than any other language your knowledge will be reusable. You'll just see whatever second language is best for getting your local job right now (and whatever third language you have to learn three-to-ten years from now) as an idiosyncratically specialized version of lisp with a new vocabulary for things.
Someone dropped this guide image in the Lisp thread about a week ago, and it looks pretty good to me. It's got several gently-sloped beginner books, including at least two I know were written to also be usable by people learning their first language, a couple books for people learning lisp specifically for the first time or just out of their first semester using it for basic algorithms, a few for journeyman programmers looking for what Lisp offers them over their weaker tools like Pascal, and so on all the way up to books like Paradigms of Artificial Intelligence Programming and Common Lisp: The Language, both considered gold-standard reference books in their subcategory. It doesn't include SICP, though, which you should certainly read, probably before LoL or so. SICP's got a bit more math sometimes than most the other books, but don't let that throw you. The math's not the valuable part.
Better than wasting your time of whatever latest web framework mess a bootcamp you might take will teach you, I think if you spent six months immersing yourself in whatever of these books you can turn up pdfs for (I've got a couple of them, so they're out there. In fact, I even found this list https://common-lisp.net/documentation while looking for the picrel quote, which I think is where some of my sources got them), you'll save yourself the money and come out further ahead in the range of things your knowledge will be good for. So grab a copy of CL:AGItSC, stop worrying about everything else, and come back in a couple months with the confidence to take on anything else.
KuriGohan and Kamehameha · 2023-12-19 05:26
>>37973
You really convinced me. I already downloaded the first book and I will start it today. I only didn't bought it because I'm a poor NEET. Anyway, thank you so much, lainon. I will come back and post my experience here.
Demeere · 2023-12-19 05:53
>>37973
nta which is the best lisp dialect to start out with?
Random · 2023-12-19 08:57
>>37977
To start with? Probably some kind of Scheme with defmacro. To go further? CL or Clojure.
Boris Grishenko · 2023-12-19 09:25
>>37977
To some degree, I don't think it really matters. Lisp dialects, especially post-CL, tend to be similar enough that a lot of things are similar enough in one to pick up in a day or two once you know another. Only exception would be the really obscure ones you probably didn't know about until now like Dylan or NewLisp, and to some degree Clojure. Not that these are bad languages, just that they're different enough that less transfers. It's like trying to learn all the romance languages and starting with english. Probably the best to start out with is a Scheme, like an MIT Scheme descendent or Racket, but the world won't end if you start with Common Lisp or Clojure or Emacs Lisp instead. You're just taking the steeper trail up the same mountain.
Rick Deckard · 2023-12-19 14:55
>>37977
Racket. It was designed with educational use in mind and comes with a very powerful programming environment.
Apoc · 2023-12-19 16:12
I want to compile Ardour8 from source then hopefully build a deb package I can install
When I run this python waf configure command, why does it say configure complete, even though it looks like a few things were missing? I assume those are 'optional' dependencies, but does that then mean my software will be missing features? It's a dev build with no support, so I'm sure they don't care how many features get left out.
Why does it say Checking for clang: no when I clearly have clang on my system? I'm running Ubuntu 22.04.
I also tried compiling a newer version of rubberband myself but more of the same issues arose
-
I currently have a version of Ardour7 I compiled from source, but I just went through the motions without caring about the waf configure dependencies, and I didn't build a deb package out of it, so it doesn't show up in APT.
Because it doesn't show up in APT, does this mean it's liable to break in the future if I ever install a certain piece of software for something else? Because sometimes, if I install a certain dependency APT will tell me "the following packages will be REMOVED", but I assume if you compile from source it won't do that and the software will just break, right?
Thanks Lain
John Rain · 2023-12-20 16:07
>>37983
Reàd the configure script, it's probably looking in a location that it's not in
Nameless · 2023-12-20 16:15
I'm planning on going through nand2tetris with this book. whats a good first language for me?
Meddler · 2023-12-21 06:44
I wanna create programs and games in C or C++. Should I use an IDE? Which graphic library should I use and why? A good resource to learn (a YouTube playlist, website, book...)?
quote · 2023-12-21 07:25
>>37991
you didnt mention whether it has to be 2d or 3d (which is exponentially harder and more laborious), how much time you're willing to put in, which platforms it must run on, etc.
Random · 2023-12-21 07:29
>>37991
I wouldn't advise doing gamedev like this because the workload writing your own engine is incredible high and you can either spend a month writing your own 2d engine or open godot and get the same done in a hour with a youtube tutorial. For 3d its even worse.
If you however insist:
Should I use an IDE?
yes, you need code lsp features as well as a debugger. VC Studio for easymode, Eclipse for foss lovers & ms haters. Other options are even more pain so wouldnt advice to noobs.
>Which graphic library should I use and why?
dear imgui, gives you gui in c++ within a opengl context which is ideal when you really wanna to everything yourself.
>A good resource to learn (a YouTube playlist, website, book...)?
https://learnopengl.com/Introduction if you go with my suggestion and decide to use opengl.
If you want some youtube dev to listen to then "the cherno" is a c++ engine dev who is working on his engine with crowdfunding for years. Might give you an idea how much pain you looking forward to if you decide to do everything custom.
DEBUG-CONTENTS · 2023-12-21 10:26
>>37992
My bad.
I wanna make 2D stuff. I have a lot of time and I'm looking forward to learn. I wanna create programs mainly in Windows.
>>37993
Got it, ty so much.
Anonymous · 2023-12-21 10:40
>>37994
Sorry, I forgot write a question: what about programming software in Python?
Special Agent Bob · 2023-12-22 13:43
>>37977
R5RS with Chicken Scheme.
Read either The Scheme Programming Language or Learn Scheme In Fixnum Days. Little Schemer + Seasoned Schemer is also very good combo.
>>37989
It depends on what's your goal. If you want to learn how a computer works, I recommend Programming From Ground Up. But note that you shouldn't use assembly for writing real programs. If you want to learn a good general purpose programming language that's also beginner-friendly, I suggest Lua (https://www.lua.org/pil/contents.html), Python, Ruby or Perl in that order. Lua is great because it's a small and simple language and it has pretty good design.
>>37991
If you want to actually finish your game, you should use Godot. There is no reason to use C or C++ for your game if you are a hobbyist.
But if you really want to (try) make your game in C++, I suggest using SDL2.
>https://lazyfoo.net/tutorials/SDL/
Note that you need to know C++ before you start (Godot is much easier overall). You can learn C++ from C++ Primer by Stanley Lippman , Josée Lajoie , Barbara Moo.
>>37995
Python is cross-platform and easy. I suggest using Godot + Python. There are 2 Python threads in the catalog. I think the mooc at https://www.mooc.fi/en/#courses is pretty good way to start. It also covers OOP.
Anonymous · 2023-12-23 06:07
>>38002
Reason i previously suggested dear imgui and not SDL is cause SDL is a big lib making decisions for you and you end up learning the lib instead of c++ similiar to godot which kinda beats the point imo. You can combine both too (sdl+dear imgui) but i would rather go minimalist if you already decide going custom. GLFW would be another option - just get a window with keybind interface and nothing else. Im merely peddling dear imgui cause ui takes a lot of time and doesnt really touch game design so its unecessary to rewrite an ui engine.
Lukasiewicz · 2023-12-23 19:32
>>37650
Is Emacs still the go-to for LISP I've been hearing that it's a little too bloated for a while now and I feel like I should be investing my time practicing with more widely-used tools in software development like Vim and VS Code, but I'm using mit-scheme for going through SICP and their editor of choice is Edwin.
stack · 2023-12-24 01:43
>>38007
what is emacs bloated to? vim, ed maybe. but the most popular editors and ides are substantially worse imho. the main problem in my experience with emacs is its concurrency model where computation blocks the input and rendering "threads" (not like emacs is multi threaded).
its absolutely a comfy editor for writing lisp though, but lisp can be pretty comfy i would assume in any popular editor that can send and recv strings to a running proccess, and paren matching/highlighting. i think its also an added bonus that its configuration is in a lisp, so you can often use the same ideas (but not same exact implementation) that you do in your application code as you do as your editor configuration.
i have the most experience writing lisp in emacs so i cant compare experience much, but lisp is seemingly a very easy language to support.
some useful features that emacs has may not be supported in other languages, thinking of structural editing like paredit, and once you get used to thinking in those kinds of terms, it can feel much more cumbersome to make the types of edits you can make with it, for example it becomes quite natural for me to think then do something like "take this block and wrap it in this function or macro", which i dont see wide support in the other editors i use, namely vs code and neovim (again, with less experience then i have in emacs, so perhaps user error)
Church · 2023-12-24 01:49
>>38007
a non lisp problem i have with writing in emacs for team based development (ime as work place, but also open source development) is indentation, but that can be solved with languages with autoformatters like go, or at least alerted on and prevent you from commiting incorrectly formatted code with git hooks and a linter. i imagine many popular in a commercial sense have one or both of these.
byte · 2023-12-31 04:42
>>37650
What rhe fuarrrk is a jpeg?
Jane Doe · 2024-01-02 23:48
How often do you fake your way through a project? Every time I'm working on something I always fake my way through parts of it, but I was curious how common this is with other people?
Leto Atreides I · 2024-01-03 00:43
>>38041
I dont even what it means to fake yourself through a project. Scamming like an Indian by providing a solution that doesnt actually work?
Jim Hilger · 2024-01-04 16:34
>>38042
I think the term I was looking for was "bullshitting your way through" lol. like doing dumb soykaf to kinda "band-aid" an issue
Unspecified · 2024-01-05 19:05
Is there a way to extract the Just value of a Maybe in Haskell?
Fred Nurk · 2024-01-10 12:47
I wanna programming in Linux but I wanna create software for Windows... How can I do it?
Special Agent Bob · 2024-01-10 13:03
>>38058
You can do that either through pattern matching or using the fromMaybe function
>>38113
That's a very general question. In most cases, it boils down to writing multi-platform code and abstracting away code that may work differently depending on the target OS.
If you program in some compiled language like C++ and you want to compile your code so it runs on Windows even though you're developing it on Linux, you should take a peek at what cross-compiling is.
Torvalds · 2024-01-10 17:57
>>38113
Virtual machines on Linux host with MSVC, WSL on Windows host with msys/mingw.
J.C. Denton · 2024-01-12 00:40
Teach me the ways of scraping for OpenAI api keys.
Morpheus · 2024-01-13 05:10
>>38007
Strictly speaking, knowing the basics of Vi/Vim is essential for sysadmin but not for a programmer. That being said, both Vim and GNU Emacs are very powerful editors that make sense, so you will boost your productivity if you know either one. For Lisps specifically, the editor support and tools are better on Emacs (SLY and Geiser) but Vim is usable (see the relevant chapter on the Common Lisp Cookbook). Neither GNU Emacs or (Neo)Vim are bloated. The difference is that GNU Emacs comes with a lot of standard extensions but they cost you nothing if you don't use them.
>VSCode
The problem with VSCode is that it's tied closely to Microsoft ecosystem and it collect telemetry data. It's also relatively heavyweight because it's based on Electron (= basically a stripped-down version of Chromium web browser). VSCode is not a choice if you think GNU Emacs is "too bloated" for you (because VSCode is much more bloated and it shows if you (try to) use it on a low-end laptop).
>>38113
Use cross-platform libraries and technologies. Examples: Java, Python, Tcl/Tk, Ruby, Lua(JIT), Perl...
Or use C or C++ without POSIX or Linux functions and use cross-platform libraries (like Tk or SDL or QT).
Nguoi La · 2024-01-13 16:02
>>37775
>Whats the ultimate acheivement ?
>Writing a fully-featured cross-platform operating system on your own. Off the top of my head I can't think of anyone who's actually accomplished this task.
Alan Kay hasn't done this *strictly* on his own, but he has done it and things like it several times with progressively smaller teams, Obviously first with the Alto and D-machines at PARC, but later with Squeak, Croquet, and Frank, which culminated in directing a gaggle of graduate students in creating a replacement for MS Windows/Office, along with coordinating them in a pile of original research to extend it. I'd say that might be close enough to count.
https://www.youtube.com/watch?v=BUud1gcbS9k
https://www.youtube.com/watch?v=uQTeWJNkylI
https://www.youtube.com/watch?v=ubaX1Smg6pY
I don't know anywhere near enough about it but Joe Armstrong said Niklaus Wirth (who I was sad to see passed on a few days ago on HN) did the same thing with Modula2/Oberon/Bluebottle/A2, which ETH Zurich did step in to extend at some point but specifically to enable the whole administration to work off of, which I guess they actually did for a while. He's also done his own hardware design, though, so that might be worth the time credit.
https://www.youtube.com/watch?v=rmueBVrLKcY
And it's probably not big enough for us to count it today, but L Peter Deutsch created the first interactive lisp environment on a PDP-1, and did it in only 0.18kHz and 9.2KB. His system is the cro-magnon man of the lisp machines, and them of today's interactive operating systems and development environment programs.
https://wiki.c2.com/?PeterDeutsch
Anonymous · 2024-01-16 01:10
>>38113
use SDL and put anything platform specific in a wrapper function that can be swapped out easily
you can cross compile to windows too and quick test in wine or have a vm
Yet Another Lainon · 2024-01-16 18:57
>>38123
>The problem with VSCode is that it's tied closely to Microsoft ecosystem and it collect telemetry data.
There is a libre "fork" of it called VS Codium!! I've used it for a while, it's pretty nice, but I always find myself coming back to Emacs lol
Netrunner · 2024-01-28 14:43
Where do you download CS books? I've been trying to find 3rd edition of computer graphics: principles and practice and all libgen links are down.
The Fin · 2024-01-28 16:36
>>38203
I found that just by googling it.
nil · 2024-01-29 09:17
>>38203
thegeeks.click
see also irc.irchighway.net #ebooks
McCarthy · 2024-01-29 12:07
>>38210
> thegeeks
is this any good? I can't be bothered to create an account
Faye Valentine · 2024-01-29 14:10
>>38203
>CG:P&P
The Principles part of that is solid, but the Practice is starting to show its age. Supplement with modern sources. I recommend the PBR Book for offline rendering https://www.pbr-book.org/ and Realtime Rendering https://www.realtimerendering.com/. Unless you have a mac, I suggest WebGPU as the most painless modern graphics API.
Naomi Nascimento · 2024-01-31 12:30
why do merge operations in python pandas eat up so much memory? what the hell is it doing?
Leto Atreides I · 2024-02-03 00:59
>>37650
has anyone tried the newer "Scientific Computing with Python (Beta)" course on freecodecamp? I've trying to get into programming for a while and the straightforward interactive structure seems good for me. Are there any downsides to this I don't know of?
dup · 2024-02-03 19:04
Is this book worth reading? What else do you guys recommend for beginners?
synchronized · 2024-02-03 20:00
>>38256
I wrote a review of that book. It's shorter than I remembered:
I was cleaning lately and came across this old book I'd read several years back. Despite suboptimal storage conditions it was still in a reasonable condition, so its binding was apparently worthwhile. I don't recall finding the book particularly enlightening even at the time, and I never used its CD.
The book begins with an explanation of what hacking truly is, and a C-flavored intro to programming. The first hundred and so pages go by rather easily, and it doesn't hide the underlying machine code, nor other interesting details for some things; the book then begins introducing buffer overflows and ``shellcode'' and the like. It also has chapters for networking, countermeasures, and cryptography.
While it's been nice to reminisce, I don't at all recall this book significantly contributing in any way to my understanding. I seem to recall recollecting fragments occasionally to occupy myself, but only ever as a curiousity. The information in the book is certainly outdated in many ways, and I've pursued the path where such trivial exploitations aren't possible. I could certainly appreciate the book more now, but lack that want. In this context, I can only recommend it for an ignorant reader.
>What else do you guys recommend for beginners?
I'll include two more reviews, these of books which I actually recommend:
>The recommend book is ``CODE'' by Charles Petzold (ISBN 978-0-7356-1131-3). Information concerning it may be found here:
http://www.charlespetzold.com/code
This is a book I've casually recommended before for those who seek to understand the fundamentals of automatic computing. The book begins by introducing the concept of codes through Morse code and the importance of two through examinating this. It then continues by explaining the origins of Braille, making certain to highlight the distinctions between different representations for the same concept.
The book continues to then explain electrical circuits with pleasant diagrams, and slowly introduces encoding information through electricity. It later begins introducing the concepts of number bases, Boolean logic, and this symbol manipulation to perform arithmetic.
Being brief, this book moves from abstract codes to electrical diagrams to Boolean logic to abstract circuits to higher constructs such as memory to Turing machines, building a gradual understanding of what an automatic computer is, then moving on to more abstract software topics.
This book can help instill an understanding of automatic computing, from its fundamental principles, and I can recommend it to anyone who wishes to learn of such things. I've not compared this book to freely available courses in the same, as I've not read any of them; I will likely update this review in the case I ever do.
>Under review is this website:
https://ngnghm.github.io/
I first read this website years ago, and it seems to be rather finished by now, although some future chapters may arise yet. The website details a man discussing computing with an equinoid alien named Ann, and this is inspired by ``Gulliver's Travels''. It's a fascinating set of documents explaining an alternation from the current state of computing, even if none of it be actionable in the present. Regardless, it has been an influence on how I view computing and design, and I recommend reading it.
The first chapter concerns those differences between ``computer systems'' and ``computing systems''. I recall no more if my belief that supposedly-simple human computer systems are actually grotesquely complicated, viewed as a whole, came to me through this chapter or not. The second chapter concerns itself with persistence of information before segueing into the arrangement of systems for achieving it properly; in particular, orthogonal persistence allows a system to be fundamentally simpler while few pieces of the system need be aware of its presence. A related topic further elaborated later is proper abstraction allowing powerful programs manipulating programs to work properly, transparently.
The third chapter deals further with persistence. Session preservation in human computer systems is incomplete and complicated. This is the first chapter noting how human computer systems are divided into ``applications'' without good cause. It's a strange and powerful feeling to separate data from representation, in human computer systems, but this is how the computing systems naturally work; the file path of human computer systems is but a lesser form of what better systems call an access path. I disagree about ``The general answer is that to fix a system that has entered a bad state, you need an external system that can stop the broken system, inspect it, fix it, and restart it.'' yet accept it may always be needed in practicality; this idea is likely from the Lisp Machines, which had such. This is also the chapter detailing what proper virtualization would be; it happens not at that level of machine instructions, but the level of logged changes at whatever level of abstraction be needed.
I often think of that concept in the fourth chapter, software towers. As written: ``Humans can only build software but up. Houyhnhnms can build both up and down.'' I still believe the latter systems can be thought of as being one tower, just as in human computer systems, and it be merely the proper tower has been chosen. It's again but a matter of powerful programs manipulating programs properly.
Kernels, as in human computer systems, are irrelevant, as described in the sixth chapter. That idea of but one kernel enforcing permissions, managing resources, and providing abstractions is obviously silly compared to that idea of multiple kernels doing this in whichever ways be needed, at whichever levels of abstraction be best; further, such a system is more efficient without constant checks done while the programs execute rather than but once where feasible. Again, this may be the source of my belief that a proper system initialization would simply load that current state and do nothing more.
Chapter seven is about platforms over applications. Once again, my belief that video games are done about as well as they can be, unlike other programs, may stem from this chapter; video games needn't interact with a greater system much, are often finite-state machines, and improperly giving commands to one isn't met with an undo system but getting better at giving them. The basic idea is of adding to an existing base, rather than starting anew, and is deeply related to that concept covered by the eighth chapter, communication. The act of copying-and-pasting is called ``implicit communication''. Very interesting is that concept of a meta-program, with virtual terminals being used as an example, a program which functions as an intermediate party and of which no programs need be aware. I'd once experimented with creating such an interface, to abstract and simplify the design of a program I was writing, but the issues posed by the greater language meant it could never work, and I then gave up.
The ninth chapter covers ``build systems''. I believe there should be no such thing as ``building'' software in any way distinct from programming it; the end result should be immediately usable. More interesting are the notes on managing namespaces, if only because I also disagree on its notes about software finalization; it denies the idea of finished software, which I consider to be unreasonable.
The eleventh and final chapter deals with the nature of blame, and forms a good rebuttal against men who would encourage bad tools to be used due to personally enjoying them, despite the havoc wreaked.
It's clear to me that there's no way to turn a human computer system into a proper computing system; a total changing is required. Human computer systems are dominated by a fixation on hardware rather than mathematics; they feature determinism, while making almost none of it usable through any means.
It's good to once again read the writings of a man who understands perfect abstractions can, and do, exist. It's unlike the incompetent filth who deny such things, purely as matter of self-protection.
A major theme of this work is that human computer systems don't provide nearly enough functionality, requiring the constant bespoke reimplementation of many needed things across the system. Another of the particularly amusing ideas in these writings is that of programmer liability, which haunts those incompetent people calling themselves programmers. I'm left with the sensation that a fixation with absolute correctness can entirely eliminate many of the problems described in this website; this may appear to be akin to the solution of all medicine being to eliminate disease, accidents, and genetic defects; still, I'm pursued by the idea of simply getting software right the first time and forever.
Nanashi No Gombe · 2024-02-08 12:28
Could you guys suggest a project I can work on? I'm pretty lost with programming I've experimented with a few things but I can't seem to find anything worthwhile so I think that if I can find a project to work on it might help me find my way.
() · 2024-02-08 12:54
>>38304
an everything-app for your own use
it can be a web/desktop/mobile/cli app, but you must focus on implementing only the features you need and you must actually use it
for example daily TODOlist, habit tracker, reminder list, daily quote/image/article are some things I have considered, but you might have different priorities, so just make what you think you will use
Roger Pollack · 2024-02-12 14:42
whats the best way to encrypt my DNS?
Terzibashjian · 2024-02-13 11:15
Do any of you know any good books for learning bash/shell? I have a basic understanding of it through trial and error, but I was hoping that there was something that was aimed more towards doing cool things with it.
I remember watching this youtube video from the AT&T Archives about UNIX, and they give this example program that's a one line spell checker.
https://yt.cdaut.de/watch?v=tc4ROCJYbm0
bash
makewords sentence | lowercase | sort | unique | mismatch
I don't think it works on anything modern, but are there any good resources for learning how to make things like that?
Mentat · 2024-02-13 20:08
>>38342
It's not bash orientated (matter of fact, I think they both cover a minimal alternative, sh maybe), but The Unix Programming Environment and Advanced Programming in the Unix Environment.
Bashisms.org is good for bash specific.
Always use shell check.
https://shellhaters.org/ and https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/
`man bash` particularly QUOTING, PARAMETERS, EXPANSION, REDIRECTION, but read it all.
Notably of your example, sort and unique are posix standards so `man sort` and `man unique`. `man -k $command` to search for man pages. `man intro` for beginners.
Additionally, try to keep in mind shell scripts and your own limits. There comes a level of complexity that every author has to find for themselves that shell scripts are rarely worth surpassing with. In these instances you have many options available to you, obviously if you already know a programming language, otherwise python is popular, perl was, and I find it more joyful to write, theres PowerShell if you're on a M$ platform (I know it's technically cross platform, but who DOES that?), ruby for hipsters, but still supporting the useful one-liner flags of perl (lanpei), theres awk which is POSIX so its included even more distros than any of the prior options, even perl is. For me that complexity is just above an looping and conditonals. Oh that reminds me: `man test`.
Miho Iwakura · 2024-02-20 09:53
>>38304
Try Project Euler or try making a simple chat program (search internet for guide on socket programming for your favorite programming language). Then try making IRC bot.
>>38256
Learn Python for free at https://www.mooc.fi/en/courses/
>>38342
>Do any of you know any good books for learning bash/shell?
The Linux Command Line (free book) => https://linuxcommand.org/tlcl.php
Advanced Bash-Scripting Guide (free) => https://tldp.org/LDP/abs/html/
These 2 are the best resources for learning Bash and the command line.
Tank · 2024-02-21 01:44
Is it still worth learning to code?
I was thinking about learning to program, to quit my dead end job. The problem is that I honestly don't think I would be able to get good enough before AI just kills of any opportunity for entry level jobs. Sure, I think high IQ and dedicated people will have job security for a longer time, but I don't have high IQ, if I had I wouldn't be working in a dead-end job in the first place. I am 30+, so I start with nerf because my brain has peaked like a decade ago according to The Science (tm).
Nanashi No Gombe · 2024-02-21 02:55
>>38393
It depends on your social skills and ability to network, like everything else.
I learned to "code" and got degrees years ago but its worthless because im an anxious autist.
JARGON · 2024-02-21 03:25
>>38394
I would say that my social skills are okay, while I am an introvert, I can handle people in a work context. As for networking, I don't have a network so that is unfortunately a moot point. Of course I can relate to the anxiety issues, it's the big thing I need to deal with, and feeling trapped sure doesn't help.
J.C. Denton · 2024-02-22 14:27
>>38393
i think the future of programming will be middleman job between regular people and ai.
Personal question:
Did anyone try browser plugin development?
Im curious how much control you have. Ive seen spoofing addons on pale moon so i would assume you can encapsulate/overwrite native functions?
Would an addon that parses the page and modifies content be possible? And what about internal caching? For example lets say you want to write an addon for this site that simply remembers the threads you visit and has all old posts minimized to let you instantly see whats new from last time you opened the thread. Not much functionality wise but covers all basics for more extensive ideas.
array · 2024-02-23 20:09
>>38412
I've done a little for Firefox, but it's not much different for chromium. Yeah, anything you can do in javascript, you can do with a user extension. It's basically like loading a javascript file that's triggered on certain URLs and loaded into the page itself. You can directly access the HTML and you also have access to localstorage, cookies, etc. It's very similar to making a website in a way. You also have access to other APIs so you can do a bit more than just any old website could, but it's pretty easy to get into once you learn the basics.
For the things you're suggesting, try writing a userscript and see if you can accomplish what you're trying to do rather than a full blown extension. It's a lot easier to share it with people that way, and you don't have to do hacky stuff to run it on your browser if you don't have the developer version of firefox and you don't feel like publishing it.
I heard that in the past, you could do even more, and that the new extension API is actually pretty limited compared to then. That was a big draw of pale moon, that it supported the old extension API. But I don't know much about those days.
Roger Pollack · 2024-02-24 04:11
>>38418
i remember outrage news that their api change would protect advertisers and help tracking by limiting addon writer capabilities.
Btw if its just JS files don't you get in trouble with clashing variable/function names? And what about order of execution. If you have 2 addons you need to decide who goes first.
Dujour · 2024-02-24 08:30
>>38412
>i think the future of programming will be middleman job between regular people and ai.
Sounds feasible. I hate this depressing "world" I am forced to live in.
Six · 2024-02-28 16:08
>>38412
What is "prompt engineering" but a higher-level of programming? You're still providing the computer with a series of instructions to carry out. The only difference is that it's become better at speaking your language.
>>38421
Why is "world" in scare quotes? Is the Earth insufficiently Earth-like for you to consider it as such?
setq · 2024-02-29 06:51
>>38446
prompt engineering is talking to the guy at your holiday resort in broken english vs using a prof translator (programmer) who would translate accurate what you want. AI adds a incredible abstraction layer that replaces experts but it comes at the price of accuracy.
You had the same discussion with assembly vs c and later c vs phyton. Incrementally you increase abstraction at the cost of control which trades convenience for loss of performance. The end result is garbage software that runs as bad on modern 5ghz hardware as win95 software ran on a 133mhz cpu.
swap · 2024-02-29 11:50
>>38412
>>38421
>i think the future of programming will be middleman job between regular people and ai.
there still needs to be people programming the ai, no?
Bob Arctor · 2024-02-29 11:57
>>38451
>get the ai to do most of the real coding
>the 'programmers' are 90% just prompt engineers and 'data scientists' who just throw gobs of data at the thing and tweak data parameters to try and maximize certain metrics
>the other 10% are devops who just need to keep the servers running at all costs
Mario Rossi · 2024-03-01 06:25
>>38451
As much as there are currently engineers designing the CPUs of cour computers
The Oracle · 2024-03-01 12:44
How to avoid getting sleepy while reading textbooks? Yes, I've had a good night of sleep, exercise, eat well,etc. Since I'm really talking about PDFs I'm thinking of just reading them on a laptop while walking around.
XERXES · 2024-03-01 13:30
>>38457
sounds like someone's having a procrastination problem right there.
barely touched my textbooks today but seeing your post helps me find that strength I've been trying to muster lol
x<->y · 2024-03-02 01:48
>>38446
>Why is "world" in scare quotes? Is the Earth insufficiently Earth-like for you to consider it as such?
I have nothing against Earth, the planet. I just don't like that I am trapped in this economy and society. I have never asked for it, and this body has too low of a pain tolerance to do the only rational thing. So, I am forced to watch this life with no real agency, because all the things I wanted to do are gone.
So basically the quotation marks specify that I prefer to the human made part of it, not the physical.
Agent Richard Gill · 2024-03-02 06:04
>>38457
Have pen and paper at hand. Make it a study session rather than mere passive reading. That ought to do the job.
Nguoi La · 2024-03-02 10:49
>>38460
The problem is not everything is worth writing down, textbooks have a lot of filler. I remember when I tried doing the pen and paper thing while studying OSs and I just ended up spending more time writing than actually studying, then I had this bible of a notebook with tens of pages of notes of which I used maybe half.
Hitomi · 2024-03-02 15:56
Hello anons. I don't know if this is the right thread to post this in but I have no experience at all programming. I want to do it though, specifically, I want to make websites. I don't know much about it besides the fact that JavaScript is used for that purpose.
Any good resources for web development? Do I just follow YouTube tutorials and figure soykaf out eventually?
Cowboy · 2024-03-02 16:52
>>38465
if you worked in latex then html is kinda same for websites. You learn html for website structure and then css for styling the website. Ive learned this in 2-3 weeks making just cool looking websites instead of work during holidays. With this you know how to design the look.
The other part is filling with it with content, for that you could learn programming in javascript or you could just use a existing CMS (content management system) where you simply use prior knowledge to define the look. This is how most corp sites are setup because within a CMS anyone can easily maintain a website without any deep knowledge.
Chan Siu Ming · 2024-03-02 21:52
>>38465
neocities has free hosting
cdr · 2024-03-03 09:17
>>38465
Just use W3Schools for learning the basics of HTML and CSS. Then read Mozilla Developer Network articles for more in-depth info. There is also a free full stack course at https://www.mooc.fi/en/courses/
Marly Krushkhova · 2024-03-04 00:06
I'm using Programming from the Ground Up that I saw recommended here to someone else and decided to check it and I'm actually enjoying it a lot because I gave up C when I got to pointers. However, when we got to functions and he started explaining the stack, I didn't understand it very well. Mostly the top-bottom thing, but then when it got to adding and subtracting to the base pointer register which keeps track of function parameters and local variables it got confusing. I'm also not really sure what "word" refers to besides being 4 bytes long.
Motoko Kusanagi · 2024-03-04 02:38
>>38475
Assembly word = C unsigned int
really just a data type.
Spooky · 2024-03-04 06:10
>>38476
>Assembly word = C unsigned int
Not accurate for x86/x64
>>38475
>I'm also not really sure what "word" refers to besides being 4 bytes long.
The exact definition of "word" varies for each ISA/assembly language, but for x64 (/x86_64/amd64):
- byte = 8 bits
- word = 16 bits
- doubleword/dword = 32 bits
- quadword/qword = 64 bits
Other ISAs such as RISC-V instead define a word to be 32 bits, in which case usually:
- byte = 8 bits
- halfword/hword = 16 bits
- word = 32 bits
- dword = 64 bits
- qword = 128 bits
Assemblers typically also define .short/.int/.long etc but I would avoid them in favor of {,d,q}word if possible.
>but then when it got to adding and subtracting to the base pointer register which keeps track of function parameters and local variables it got confusing.
Nowadays not all arguments are passed on the stack, only if not all of them fit in registers. You need to look up what it is for each ISA (and ABI). "C ABI" on x86 is typically SysV ABI.
https://wiki.osdev.org/Calling_Conventions is a good resource.
>Mostly the top-bottom thing
Think of an array going going from 0, 1, 2 ... to the end. A call stack typically goes in the reverse order, from the end, end - 1, ... 2, 1, 0.
For example, on x64, if RSP is 0x10000 and you push a qword (it's always 8 bytes on x64) then it first subtracts 8 so the address become 0xfff8, then the qword is written.
Turner · 2024-03-05 18:16
>>38477
you are right but you are also hammering with too much info imo. Knowing its just a positive integer is the important bit for understanding what it is.
Also data type bitlength is nowadays not tied to architecture anymore- you can set it in compiler settings and unix diverges from windows in default values from what i remember. Point was packing data tighter to save memory footprint.
car · 2024-03-06 09:15
Anylainanon has a good book recomendation for learning assembly on linux?
push · 2024-03-06 09:22
>>38484
>Any lainanon
Fixed.
Cypher · 2024-03-08 07:51
Hello guys. My gf seems to be interested in programming, and I would like to show her something (I don't know how far we will go but anyway it can be fun to try).
She doesn't know absolutely anything about programming, she tried a free course about Java web apps some years ago but stopped after the first lesson. So I wanted to ask her why she wants to learn and decide which language to use depending on the answer. But I suspect that she is simply curious and wants to see how programming works, without a clear goal.
So, I was thinking about starting from python, since it is apparently a simple language for a beginner. However, I am worried that python works often differently from most languages, and I think that this simplicity is only apparent since under the hood things are quite complicated. For example, the "variable is a memory location which holds a value" does not really work since variables are actually references, unlike for example in c or c++.
What do you think? Would you use python if you were in my situation? Would you, for example, explain variables as references but mention that in other languages they are memory boxes?
car · 2024-03-08 11:03
>>38491
Start with HTML and then client-side JavaScript and show how it can help with validating inputs in web forms or something or how it can make things look pretty/glitzy or have fancy animations. Maybe have her make tic-tac-toe, hangman, a word game, battleship, or some board game (I don't know what she's interested in) in client-side JavaScript. Then introduce some backend web language like ExpressJS, Ruby on Rails or PHP (without a framework), and have her make a mockup online clothing store with a shopping cart system. Let her use AI like Bing Image Creator to generate these placeholder store item images. After that maybe there could be something interesting in the Python ecosystem you can introduce. The problem with Python is most of it is too command-liney, women prefer visual stuff, there's a reason Linux users are 99% male whereas females make up an overwhelming majority of Mac users (but aren't the ones who waste their time on MacRumors and similar sites boot-licking Apple in the comments section to defend them whenever they do clearly anti-consumer practices). Don't even bring up C or C++, women lack the attention span for low-level stuff, they are better off remaining in garbage-collected languages.
synchronized · 2024-03-08 11:53
>>38491
With my ex I tried this book: https://paulmcfedries.com/books/web-design-playground/
Also suggested Go (for writing a text adventure game, because I think that's cool).
Anyway it didn't work for us.
I think you should ask her what she actually wants to make/accomplish, and go from there.
vector · 2024-03-09 00:47
>>38494
>>38495
Thank you guys, your answers are very useful. Unfortunately I don't have much experience in web development and I don't think I would be confident in teaching languages I barely know... Even though the basics are fairly simple and I should be able to grasp them easily. I will think about it! And well, maybe she won't even mention programming again and we won't do any lesson, we'll see.
Nell · 2024-03-09 02:20
>>38491
Don't get hung up on implementation details. What is a variable? It's a named, changeable value. No more, no less. The conceptual logic and algorithms are the most important, and Python is a perfectly fine beginner language. Hook her up with Tkinter so she gets quick visible results.
>>38494
Why would you want to inflict the morass of webshit on an unsuspecting beginner? What kind of monster are you?
Jens Hansen · 2024-03-09 02:38
>>38491
Do you know if she has any programs she uses for her hobbies that allow extensions? Maybe her hobby is virtual art and she uses Krita, so you could show her how to use Python to write extensions? Maybe she makes music with Reaper and you could show her how to use Lua to add functionality? Maybe she plays Minecraft all day and you could teach her how to use Java to write plugins for it?
I think tying it to something she's already familiar with and enjoys is a good approach. Too many beginner programming courses are just "here's some syntax let's do fizz buzz and fibonacci and make a mad libs game" which has the effect of boring people to death.
藤原純一 · 2024-03-11 01:40
>>38499
>>38501
Thank you guys for the ideas! For now she seems interested but not that much,so I won't insist, I'll let her ask me again if she wants to try.
Linda Lee · 2024-03-14 06:06
What do you guys think about CS:APP? Am I expected to have prior knowledge on something specific?
Tyrell Wellick · 2024-03-14 06:21
>>37650
Has anyone tried building an imageboard like 4chan with modern tech like lets say nextjs?
Neuromancer · 2024-03-19 00:23
>>38546
What reason is there to do so?
Motoko Kusanagi · 2024-03-19 16:37
>>38546
It wouldn't make much sense to use bloat SPA frameworks to make something as small as an altchan. I would be lying if I said I haven't thought about making one using React/Express.js before though.
Nameless · 2024-03-19 17:19
Is C++ better than C# which is owned by ((Microsoft))?
Dujour · 2024-03-19 17:24
The NSA is really capable of decrypt anything using quantum computers?
Apoc · 2024-03-19 17:25
>>38593
*clubs them in the head with muh D*
Decrypt this!
nil · 2024-03-19 22:32
>>38593
My understanding of the field suggests that quantum computers that can actually do anything useful are years if not decades away
The Fin · 2024-03-20 14:57
>>38593
short answer: no
long answer: yes
Jet Black · 2024-03-20 21:17
>>38593
Short answer: yes.
Long answer: BQP =/= NP, so only if you let them.
Kay · 2024-03-26 07:15
>>38593
Cryptographer here. In theory yes. In practice, not yet. The NSA is advanced, but they aren't that much farther than existing academic institutions. There exist plenty of quantum computers, but the most powerful ones are currently the quantum annealing type, which are not able to break cryptography.
The only cryptography that is at-risk is cryptography with hard problems that are in the BQP (Bounded-Error Quantum Polynomial time) complexity class. This includes cryptosystems based on integer factorization (RSA, Rabin) and the discrete logarithm (DH/ECDH, DSA/ECDSA). Cryptography that is not in BQP whether because it's symmetric (AES, SHA2, virtually any symmetric cipher or hash) or because it was designed to resist quantum computers (Kyber, NTRU) are not at risk.
A "true" quantum computer can perform a step called the quantum fourier transform. This is the magic ingredient needed to implement big scary Shor's algorithm which can crack RSA in polynomial time. In order to break RSA, a quantum computer needs a little bit over twice the number of qubits as there are bits in the key (so RSA 2048 would require about 4096 quibts). The same is true with DH. For ECC (elliptic curve cryptography), it requires six times the number of qubits as there are bits, so secp256r1 which has a 256-bit key would require 1536 qubits). Note that these are *logical* qubits, not physical qubits. In the real world, qubits don't work quite right, so quantum error correction is needed. One logical qubit may require hundreds of physical qubits.
Can the NSA break RSA right now with a quantum computer? No, highly unlikely. Will they store TLS handshakes and public keys on their huge arrays of hard drives until they become a reality and they can just contract a major university or defense contractor to break them? Sure they will. This is why post-quantum cryptography is important.
(Yes I know Grover's algorithm exists. No, it is not a threat, even for 128-bit ciphers. Quantum operations are not as cheap as classical operations, and Grover's is like kicking dead whales down the beach at being parallelized)
tl;dr Quantum computers can break most public key encryption (i.e. internet traffic). They cannot and will never be able to decrypt your hard drive. But they don't yet exist.
Nell · 2024-03-26 13:07
So, I know that it's probably good for me in the long run to be able to code. I have basic knowledge of shell scripting but not much beyond. I haven't picked up a proper programming language yet because I have nothing on my mind that I would want to create but doesn't exist yet (and requires more than a basic shell script). Can someone give me a suggestion to motivate me to learn, or perhaps a useful resource or youtube channel that could possibly get me hooked
x<->y · 2024-03-28 02:18
>>38630 How do people comprehend and invent quantum circuits? They are so weird that it feels like they cannot be comprehended. While in classical programming we just write what we think, in quantum it looks like several weird seemingly irrelevant magic gestures result into a result ... And for another algorythm one has to guess the right sequence of gestures again.
Unknown · 2024-03-28 07:11
>>38634
Introduction to Computation and Programming using Python 2013 Guttag
Splicer · 2024-03-28 17:39
How do you get datasheets, "publicly" available only on CSDN?
Lunch · 2024-03-28 21:11
Hey, is there any way to pause a thread in python, then resume it after a while? Googling isnt helping much. And if its not possible. Is there any other way to pause a task for a bit and have it run again from that point. Its for a small bot im making to develop my python skills.
Masami Eiri · 2024-03-28 21:37
>>38667
It sounds like you want a sleep; there is a sleep() in Time module but also several other ways of accomplishing this, so you may want to look up "python sleep" and see what else there is, especially if what you actually want to do is wait until something else happens/appears/etc.
Yu-ichi · 2024-03-29 10:10
>>38667
As already mentioned, time.sleep() if just waiting for some amount of time.
If you need to wait for a certain event, look into Condition/Semaphore/Event/Barrier/... objects https://docs.python.org/3/library/threading.html
藤原純一 · 2024-04-03 17:26
>>38630
Which program do you advise for encrypting archives? Which cypher should i use in LUKS to encrypt my hard drive?
Ishikura "Tatsu" Tatsuhiko · 2024-04-04 05:19
I'm trying to learn how to reverse shell from my server to my laptop to send files after they're done processing. I'm wanting to use a reverse shell because my laptop obviously isn't always online, so I'll want the server to try reaching out to me regularly and if it gets a ping back, then it'll ship the files back.
But I've heard that many of the encrypted reverse shells one can launch using TCP sockets with Perl, GnuTLS or OpenSSL are vulnerable to MITM attacks when performing the first handshake. If so, how does this work exactly? And how could this be defended against?
Turing · 2024-04-04 06:16
>>38698
>many of the encrypted reverse shells one can launch using TCP sockets with Perl, GnuTLS or OpenSSL
What you're looking for is rsync over SSH, or even more simply just using scp from your server to your laptop. You'll need to create a unit file for systemd, if you're using that, for periodic attempts at connecting to your laptop or some other cron-like definition depending on your init system.
Nameless · 2024-04-04 12:38
>>38699
If it were from one linux machine to another, sure, but this would be between my friend's Windows 10/11 computer and my Linux laptop, and I'd want to use the situation as an opportunity to learn some TCP socket programming in a language like Perl or elisp or Rust. Idm which, I'd rather not install ssh or rsync on his machine.
BloodCat · 2024-04-10 10:28
Dipping my feet back into HTML n' Co. for a personal project.
Anyone tried to fetch links from one's bookmark from a browser and display them on a local webpage? Of course I could just export my bookmarks and insert the content in my webpage, but that would require me to export my bookmarks everytime i update it with new content. Search engines are failing me atm. Feels like nobody tried to do that.
(I can also guess it's not an option for privacy reasons)
sandwhich · 2024-04-10 10:55
what's a way to learn java, C++ or Python in a more interactive way then just watching a video that takes 100 light years to finish
Nell · 2024-04-10 11:34
>>38778
Poster here. I found that URLs are stored in a file called favicons.sqlite inside a firefox browser i use. They may be stored else where but this file is good enough. plus it provides favicon like the filename suggests.
FILLER · 2024-04-10 11:38
>>38779
for java I'd suggest writing a basic crud rest service with spring boot. So much material online, very easy and helpful if you need a job
for c++ I'd say find a protocol and try to implement it using c++ stl, utilizing oop and design patterns. very fun and helpful
for python no idea, you could go the java route but use django. Otherwise I could imagine automating every day stuff (data entry, smart home) around you could be nice
Kay · 2024-04-10 13:21
>>38778
>>38778
sqlite3 places.sqlite "select url,title from moz_places \
where id in (select fk from moz_bookmarks where fk not null);" \
| sed -e 's/^/<a href="/ ; s/\/|/">/ ; s/$/<\/a><br>/'
flood detected post discarded
this chan is the most retarded
why are you so fuarrrking guarded
this is something that you started
aliased · 2024-04-10 15:09
I'm getting into system programming, and boy do I hate windows even more now
Drano · 2024-04-12 10:53
>>38779
>Python
Definitely start with Python because it's the simplest and easiest of these 3 langs. There is a free MOOC course (with exercises) at https://www.mooc.fi/en/courses/
>>38785
You can dual-boot Windows and GNU+Linux very easily. Just use the Windows disk management tools to shrink a partition (like your C drive) and reserve about 50 Gigs or more for Linux. Then install something like Linux Mint (preferably the Mate version) or Xubuntu/Lubuntu on it (the installer can do partitioning automatically if you want to, or create the / partition "manually").
PS.
Use Rufus for creating the installation USB flash drive and use PowerShell to check the iso checksum: Get-Help -examples Get-FileHash
>>38484
Programming from ground up book and look up Gnu AS and NASM. Or start with something simpler like Zilog Z80 asm.
>>38592
It depends on what you want to do. For web apps and CRUD apps, C# is vastly better (C# is kinda like a clone of Java).
C# and .Net are more open than they used to but they are still mainly tied to Windows world. If you want Java, Python and Golang are better choices for Linux users.
Spike Spiegel · 2024-04-12 12:57
>>38807
Agreed- I've done those python courses, they're decent. First one is *very* easy if you have any experience with programming, but should go pretty quickly.
There's also a really nice free Haskell MOOC at the same university: https://haskell.mooc.fi/, though I think Haskell is kind of a crap language to pick if you actually want to make something useful. Interesting, at least. Great material.
Hitomi · 2024-05-01 20:21
Hello Lainons!
I'm a fresh grad. And I've gotten my hands on a quite large project.
My programming knowledge is pretty much surface area, the kind you learn from college.
What are some good ways to jumpstart my technical abilities, for the next few days?
For context, the project we are working on is a distributed system, predominantly in C++ with Python to some extent.
To be specific, I'm having some hard time understanding the interaction between systems, both because of the pretty advanced use of code and the complex architecture of the system itself.
Mitnick · 2024-05-01 20:35
I'm going through some elementary CS exercises and there's one about creating a generalized program for calculating finite continued fractions. This isn't too hard going from the first values of the numerator and denominator to their kth values, but what I want to know is if there's a convenient way to do this backwards, where their kth values are calculated first and added as part of the denominator of the fraction of k - 1. It's bugging me because it makes so much sense on paper but not in practice.
Demeere · 2024-05-01 21:12
>>39000
I should add that I'm wondering if this can be done as a recursive process.
H.R. Giger · 2024-05-03 17:31
What are some good books and journals on CS that aren't textbooks? Should I try to read whatever I can even if I don't understand it all?
monoe · 2024-05-04 06:42
>>38998
>What are some good ways to jumpstart my technical abilities, for the next few days?
start by ensuring you have a solid understanding of distributed systems and the basics of python/c++, then take a deep dive into these languages and familiarise yourself with the project's external dependencies. this should be enough to start tackling the actual codebase.
>>39001
>I'm wondering if this can be done as a recursive process.
whilst yes, it technically can be done recursively the implementation is better done iteratively as it requires we store intermediate values
>>39013
what subfield/topic(s) are you trying to learn? CS is actually a quite broad field
Pris · 2024-05-04 10:33
>>38998
As with any large software system you need to figure out the source tree first, identify the main components, and the points where it interfaces with the user, relate the IO functions to your own use of the system, and if you can, run an isolated instance where you can make small changes to probe it and to run individual functions to see what they do.
Lunch · 2024-05-05 07:25
>>39023
>what subfield/topic(s) are you trying to learn? CS is actually a quite broad field
I'm still learning about the field so I'd like to know a little about everything, but I suppose where I'm having the greatest difficulty is networks and networking concepts.
Case · 2024-05-07 18:00
How important books like the ones in the pic are? I mean, I tried reading Clean Code and Refactoring but found them BORING AS fuarrrk plus I feel like a lot of what the authors say is just common sense in programming.
Emmanuel · 2024-05-07 19:51
>>39059
you have to read them in order and do all the exercises, no skipping!
push · 2024-05-07 21:00
>>39059
>>39060
I doubt they have exercises, they all look like useless theory books by people who don't actually program.
And mythical man month is about how management is retarded not so much software development.
Gyula Kovacs · 2024-05-07 22:26
>>39059
So I've actually read all of these except code complete 2, which everyone always told me was a waste of time.
Clean code: outdated and yeah, everything is kind of common sense now. Useful from a historical perspective maybe. The context of it is that a lot of these were new ideas at the time, people were still wondering if they should use goto or not.
Prag Prog is a classic, most of it still holds up, some is outdated. I haven't read the 20th anniversary version.
Refactoring is pretty good but I don't remember much of it so I guess it didn't stick.
GoF Design Patterns is useful context but dry. Everyone owns it, nobody actually reads it all the way through.
DDIA and Building Microservices are probably the best books on this list. DDIA makes you understand how things actually work and has a really good set of lectures online. BM is an excellent cross-section not just of microservices but how software is actually built in a professional environment.
DDD has good concepts but is too fuarrrking long. There are two books dedicated just to trying to make it shorter. Read one of those instead.
Skip Clean Architecture/Coder. CA is not really how anything is done in the real world and overly restrictive. Really, Bob Martin hasn't had any good ideas in years.
Feathers' Legacy Code is good but also very dry. It has useful techniques for when you inevitably find yourself in some brownfield project tasked with delivering something impossible.
Beck's TDD is seminal. Holds up. Actually do the exercises on this one.
PEAA is one you don't see recommended often. I don't remember a lot of it if I'm honest.
Head First DP, or, the STD book as it's commonly known, is just an easier version of the GoF book.
Hagbard Celine · 2024-05-07 22:35
>>39059
>>39062
A few others I would recommend:
- Four Rules of Simple Design
- The Art of Unit Testing, Osherove
- Site Reliability Engineering
- Elements of Clojure by Zack Tellman
- Seven Languages in Seven Weeks
- SICP but only if you're determined and have a lot of free time
Also don't expect to read all the books on that or this list in a short period of time. It took me about 15 years but I did also read a lot of terrible ones. There's no rush. Maybe start with Building Microservices.
Acid Burn · 2024-05-08 12:48
>>39061
it's a joke picture, just look at it.
>2 books on design patterns, one for babies
>enterprise application architecture
>one for working with legacy code
no doubt these are things that are useful for people who work with legacy or enterprise code, but they are not really about programming and not at all useful for the average programmer.
It is a satire of /sci/ curated book lists which suggest absurd titles.
Nell · 2024-05-08 20:46
>>39067
The mainstream view is a joke, so it's impossible to tell if it's satire or not.
Many people take this nonsense very seriously and are hard at work making computers worse.
Joe Bloggs · 2024-05-11 08:35
haskell should have been easier. too bad i'll never learn category theory
monoe · 2024-05-12 00:47
>>39094
why not? category theory is awesome
Unsigned · 2024-05-13 06:06
>>38998
Learn git (or alternatively, Fossil). It can save your project, and it makes co-operating with other programmers much more easy.
>>39059
In my opinion, the only books you should read from that list are: Designing Data-intensive applications and either Design Patterns or Head First Design Patterns. The design patterns books are only useful if you plan on using OOP.
Meddler · 2024-05-13 16:15
>>39095
>category theory is awesome
and a waste of time
overriding · 2024-05-14 08:04
Can someone explain what is wrong with this code? It's supposed to take a series of numbers as its argument and return numbers of the same parity as its first argument.
scheme
(define (same-parity value . x)
(let ((op (if (even? value) even? odd?)))
(define (loop new old)
(let ((test-value (car old)))
(cond ((op test-value)
(loop (cons new test-value) (cdr old)))
((not (null? old))
(loop new (cdr old)))
(else new))))
(loop (list ) x)))
Dozer · 2024-05-15 18:37
>>39111
There are a few things wrong with your code. First of all, you aren't checking if old is null before you take the car of it, so that results in an error. Second of all, you are consing the test values to the new list backwards. It's easiest to think of it as you always cons to the beginning of a list, and you always car from the top. The way you have it, it won't return a list, but a really weird data structure (try it out).
Here is a corrected version of your code:
scheme
(define (same-parity value . rest)
(let ((op (if (even? value) even? odd?)))
(let my-loop ((new-list '())
(old rest))
(if (null? old)
new-list
(let ((test-value (car old)))
(cond ((op test-value)
;; This will return the list backwards
;; You can use (append (list new) test-value) instead
;; But that might be slower
;; Or you can reverse the list once you're done
(my-loop (cons test-value new-list) (cdr old)))
(else
(my-loop new-list (cdr old)))))))))
I tried to make it a little more idiomatic while keeping the spirit of what you wrote.
This is how I would write the same code:
scheme
(define (same-parity value . rest)
(filter (lambda (test-value) (eq? (even? test-value)
(even? value)))
rest))
Hiro Protagonist · 2024-05-16 20:37
>>39121
It's funny, the issue that prompted me to make my post was because I was foolishly feeding a list as input rather than multiple arguments, not because I thought there was anything structurally wrong. Thank you for the feedback.
Jens Hansen · 2024-05-17 13:57
Is it possible to make variadic function in haskell that puts its arguments in a list? I can do that for any specific type easily, but I want it polymorphic, that is one implementation for all argument types. Of course all arguments are of the same type.
protected · 2024-05-20 01:18
Funny how I tried sending this question to haskell cafe but it never got posted, probably they're tired of answering dumbfucks like me and have some kind of a language enhancer to avoid lains like from even trying. Fair enough, so no hard feelings, just needed to get that off my chest.
Rick Deckard · 2024-05-31 03:48
What's a good way to learn scheme?
I'm looking for a good resources and projects.
I started reading R6RS but I think this is not the best strategy.
I know some scheme but I haven't broken through properly. I want to be able to write practical things with some kind of graphical output.
SHODAN · 2024-06-04 02:48
>>39246
SICP
Check out the video lectures and start reading the book
It will teach you a lot about how to freely write down your thoughts as a program
sage · 2024-06-04 13:25
>>39246
Little Schemer and Seasoned Schemer were written for you specifically. Friedman and Felleisen dedicated their draft "To that one Lainchan anon in 2024" on the final page. The publisher just left it out becsuse they lacked the same foresight.
apple · 2024-06-06 05:13
i really really reallllyyy wanna learn programing but i literally have no idea were to start, i have adhd and its hard to listen to the long proggraming videos that have to the worlds most boring voices like ever :P
Knuth · 2024-06-06 05:15
>>39309
write something and make it work, glitterboy
Boole · 2024-06-06 08:46
>>39309
start with hello world in C
then incrementally add things til you have basics covered.
Once done you can use whatever language you want. Its like learning algebra before using a calculator. Helps understand whats going on.
ba arts · 2024-06-06 12:16
hello guys please recommend some beginners books for hacking. I am doing for fun just as hobby in spare time.
Elliot Alderson · 2024-06-06 17:08
>>39309
programming is really really simple, but programmers don't understand how to teach things properly so you have to bear the brunt of horrible instructional material to understand what basic concepts are being talked about
DEBUG-CONTENTS · 2024-06-07 01:24
>>39309
Watching programming videos is the easy way out when you want to feel like you are learning without putting in effort. They are terrible though.
I learned C++ when I was 15 with Stroustrup's Principles and Practice. Before that, years playing with GML learned from YoYo's documentation.
The reason why I read docs and books was because I tried the videos, and I got fed up eventually at how they are so slow and cover things I already know. I discovered with books and docs, I could just flip to it on a website or a book.
Now, when people ask me how to learn programming and I tell them to read, I can tell they really didn't want that answer. They already knew they were going to use video tutorials, they just wanted endorsement. So don't be like those people. For all I know, your ADHD brain might actually latch onto a book better.
And the thing is, if you become a 'serious' programmer, you are going to move to books anyway. If you want to do something substantial like write a program that solves some interesting problem, no video will get you there. If you want to learn how operating systems work, you'll get much worse information if you try slug through videos online.
If you are not willing to read a lot, you aren't cut out to be a programmer. You have to accept sometimes you aren't cut out for something; I've done this plenty of times. I've always wanted to be a visual artist, I even did well for a while, but I had ambitions I knew I could not live up to because I couldn't put in the time, so I cut that loss, and today I am a very good programmer.
Y.T · 2024-06-07 03:43
>>39314
>programming is really really simple
your portfolio, sir? programming literally forces you to learn complex math otherwise you're just another monkey doing some horrid crap that doesn't even work. without knowledge of algorithms you don't get any further that hello world, because you simply don't know what to do so that your program does not end up being o(10^10) complexity. and that's only to get started.
Drifter · 2024-06-07 06:07
>>39316
soykafty meme, most people dont do algorithm design, they use libs.
Its like kids playing lego. Sticking bricks together doesn't require knowledge how to make them.
Zhora · 2024-06-07 08:03
>>39317
>kids sticking bricks together
what is even the point of learning programming if you're just going to spend your life writing some miserable (unfixable, unreadable, undebugable) soykaf? sticking bricks together is only fun so long as you're under 20 years old. yeah sure if your point is to survive by wageslavery, ok no questions here, but if you genuinely want to learn monkey programming 'cause you think it's fun, no it's not fun
Molly Millions · 2024-06-07 08:56
>>39318
i would say most people code for a goal not cause its fun. Coding is largely googling how to use other people's api's cause usually documentation is even slower to decipher than finding something usable over google.
Gotta be some weird perversion to enjoy that.
Cat Mother · 2024-06-07 09:23
>>39319
>documentation is even slower to decipher than finding something usable over google
it's lucky enough if there is any documentation at all
>Gotta be some weird perversion to enjoy that.
ironic how there are so many "programmers". maybe people really enjoy getting their code to sort a list, i enjoyed it myself at some point. i just can't fathom how they keep enjoying it for so long or whatever. i'm not even sure it pays good enough to prefer it over some manual labor. it's not like mindless programming is not manual labor in itself. and no it's not gonna make you smart(er than others).
Kay · 2024-06-07 09:38
>>39320
It makes sense when comparing options - writing your own solution is more enjoyable than than googling how to use math::list. DIY gives you control while the latter puts you at the mercy of other people.
Coding is most enjoyable when you arent googling, its arguably why so many people write their own engines over using existing ones.
Pulse · 2024-06-18 11:25
Am I just retarded or is there a lot of friction in creating/maintaining a neovim config? I found it easy enough to get a small, comfy vim config that just werks but whenever I've tried moving over to neovim I've eventually found myself drowning in a deluge of cryptic errors. Pre-rolled neovim configs usually work, but I dislike the lack of understanding that comes with using something like that, and even the ones on the smaller side often feel like they're trying to recreate the entirety of VSCode inside neovim which is not what I'm looking for. Half the reason for posting is this is my own catharsis but I'm interested in hearing what other people have to say, whether they prefer neovim or otherwise.
pop · 2024-06-18 12:31
>>39361
vim is abomination i use it only because ides are not even abominable, they're just plain fuarrrking satanic. either that or i never found a good ide but i don't care. no you're not retarded. (neo)vim developers got a lil too caught up and developed a lil too much for a fuarrrking text editor
Hiro Protagonist · 2024-06-18 12:51
>>39361
i wanted to use neovim for cross os c++ as i saw it existed on both w10 and linux. I wasted a lot of time trying to make w10 neovim clangd work until i installed visual studio. So apparently it implicit relied on it. Bet the devs who wrote the code had it installed and therefore didn't see anything wrong. That was however also the only really annoying case i encountered. Outside of that its just the general issue of using other peoples extensions in any software - its not really fun figuring out how they designed it and making it work. And if you have a ton of extensions you also have a ton of work. I think it took me 1-2 weeks til i had a working neovim setup. I dont remember how i did it and just copypaste the config like a black magic spell ignorant of its inner workings.
As for maintenance? lmao im not touching anything lest it breaks. As long as it works it stays as it is.
Turing · 2024-06-20 05:33
Any programming sandboxes you people recommend?
I know i can search soykaf up but i wanna know what you people choose.
Debbie Charteris · 2024-06-20 14:04
I'm taking a computer science class (C++) over the summer, and I've been stuck on this assignment since Monday.
There is in input file, that contains data such as:
1 r 20.4 17.56 9
1 r 21.23 18.4 8
1 s 18 9 where the first number is the month, the second character is the type of workout, if its type r, the next two numbers represent miles ran, and time needed to run miles, the last integer can be discarded. If it is type s, the next integer after the s represents the weight lifted.
I have to process the data, for 3 months and record total miles ran that month, total time, total weight lifted, as well as % change in miles, time, and weight over the previous month, as well as maximum weight lifted.
The part I'm stuck at, is I have a while loop reading lines from the file, but I'm not sure how to dynamically output this information without hardcoding a variable for each of the output results... For example, I'm to assume we don't knpw how many months will be processed. I am also only to use while/for loops, if/else if logic. I can not use arrays, only basic data-types such as double, int, char, strings. Not asking for someone to post the answer, but instead to explain to me a simple process of how this works, or point out what I'm doing wrong? This class has not explained how to solve this type of dynamic problem yet, but this assignmnet is worth a ton of points and I can not afford to get a bad grade on it. this is my current (unfinished) loop for processing the file:
while (inFile >> month >> type) {
if (type == "r") {
inFile >> currentMiles >> currentTime >> happiness;
totalMiles += currentMiles;
totalTime += currentTime;
}
else if (type == "s") {
inFile >> currentWeight >> happiness;
totalWeight += currentWeight;
}
cout << fixed << setprecision(2);
cout << "Total miles for month " << month << ": " << totalMiles << endl;
cout << "Total minutes for month " << month << ": " << totalTime << endl;
I am a lurker, so sorry if I messed up the code tags, or if this question is too complex for the "simple" questions thread. Again, not looking for someone to do it for me, but give a simple walk through of how to do this with only the tools available to me.
Tyrell Wellick · 2024-06-20 14:13
>>39378
Sorry to double post, I know that the code I posted, each iteration will be accumulated to the total variables, and it will print the actual total for each variable, and not the total for each month. I wanted to give more context. I've tried using while (month == 1), if (month == 1), etc, but, again, I can not hard code in the totals for each month, I need to dynamically get the total for each month and print the results for that month in the loop somehow.
Ein · 2024-06-20 14:25
>>39378
i think you can assume the data is ordered chronologically since its supposed to be a log.
Use that for your condition.
Random · 2024-06-20 15:13
>>39380
Very close to having this program finished. Thank you, this was surprisingly helpful.
Hiro Protagonist · 2024-06-20 16:44
while (inFile >> month >> type) {
if (month != prevMonth) {
outFile << fixed << setprecision(2);
outFile << "Total miles for month " << month - 1 << ": " << totalMiles << endl;
outFile << "Total minutes for month " << month - 1 << ": " << totalTime << endl;
outFile << "Total squat weight for month " << month - 1 << ": " << totalWeight << endl;
outFile << endl;
if (month > 2 && prevMiles != 0 && prevWeight != 0) {
milesChange = (totalMiles - prevMiles) / (prevMiles) * 100;
weightChange = (totalWeight - prevWeight) / (prevWeight) * 100;
outFile << "The percent change from last month for total miles is: " << milesChange << "%" << endl;
outFile << "The percent change in squat weight from last month is: " << weightChange << "%" << endl;
outFile << endl;
}
prevMiles = totalMiles;
prevWeight = totalWeight;
totalMiles = 0;
totalTime = 0;
totalWeight = 0;
prevMonth++;
}
if (type == "r") {
inFile >> currentMiles >> currentTime >> happiness;
totalMiles += currentMiles;
totalTime += currentTime;
}
else if (type == "s") {
inFile >> currentWeight >> happiness;
totalWeight += currentWeight;
if (currentWeight > maxWeight) {
maxWeight = currentWeight;
}
}
}
inFile.close();
outFile << "Total miles for month " << month << ": " << totalMiles << endl;
outFile << "Total minutes for month " << month << ": " << totalTime << endl;
outFile << "Total squat weight for month " << month << ": " << totalWeight << endl;
outFile << endl;
milesChange = (totalMiles - prevMiles) / (prevMiles) * 100;
weightChange = (totalWeight - prevWeight) / (prevWeight) * 100;
outFile << "The percent change from last month for total miles is: " << milesChange << "%" << endl;
outFile << "The percent change in squat weight from last month is: " << weightChange << "%" << endl;
outFile << endl;
outFile << "Maximum squat weight recorded is " << maxWeight << endl;
outFile.close();
Total miles for month 1: 14.20
Total minutes for month 1: 122.90
Total squat weight for month 1: 28
Total miles for month 2: 16.00
Total minutes for month 2: 125.50
Total squat weight for month 2: 36
The percent change from last month for total miles is: 12.68%
The percent change in squat weight from last month is: 0.00%
Total miles for month 3: 21.10
Total minutes for month 3: 163.50
Total squat weight for month 3: 55
The percent change from last month for total miles is: 31.88%
The percent change in squat weight from last month is: 0.00%
Maximum squat weight recorded is 20
Ok, I'm stuck again. I do not understand why in the output the %change for miles updates correctly, but the %change for weight remains zero? I don't need the code of the solution, just a nudge as to what is wrong with my code.
Nemissa · 2024-06-20 16:54
>>39382
data type
integer wont allow fractions.
Neuromancer · 2024-06-20 17:01
>>39383
dang... yep that was it. thx.
word · 2024-06-22 08:59
Are there any good books or resources on implementing a basic web server? It doesn't need to be compliant with the whole HTTP spec or anything like that. I just want something that will give me some practice and a basic understanding of how such things work.
array · 2024-06-22 09:18
>>39390
The HTTP Wikipedia article has good technical examples. https://en.m.wikipedia.org/wiki/HTTP
You can connect to a webserver with netcat and just type in HTTP requests. To write your own program, you use a socket library, like https://docs.python.org/3/library/socket.html
FILLER · 2024-06-26 05:43
>>39390
Luke Smith's beginner webhosting resource is good: https://landchad.net/
Lain Iwakura · 2024-07-05 15:14
Has anyone ever been stuck on task, in a way you don't know how to do it but then you also really don't know why you don't know how/what/why to do? Especially for a task that is your core responsibility (meaning: you are the only person in charge down to all the little detail; pretty much interaction with others are only be at high level abstraction and as an addition, as it's quite an obscure matter of your area)
Pretty much I have been isolated for couple weeks, and my best week is literally code analysis of 2 fuarrkking functions that doesn't even lead to anything remotely meaningful. Documentation left by previous devs points only to surface level knowledge (and I firmly believe, this very issue in particular either could be solved by some spectacularly elaborate engineering ideas or just some incredibly ridiculous misunderstanding and not anything in between).
I'm collapsing in my own standing. This whole circus is like a never-ending contest of starring into nothingness. I'm independent but in a seclusion, free of formalities yet overwhelmed by possibilities. I need to move but brute forcing things now is certain to not make it work.
I was in similar situation not long ago. But got out due to extraordinary circumstance (project refocus). This time I'm simply desperate for an answer--and exclusively for the question of my own curiosity. I'm certain that the root problem is likely how I conduct myself in this situation, my ethics in question.
How did you navigate this ordeal lainons?
Armitage · 2024-07-05 16:35
>>39495
I think I get this. In my case its related to decision anxiety. There's half a dozen ways to do X that I can imagine, but which is right ? Which is perfect ? Hard to know. Just do something, and get it working !
Ive been putting off a little project like this but Im gonna finish it this weekend or jump off a bridge.
Kay · 2024-07-06 17:04
Thinking of making something to organise all the images and videos I've got (tagging and search features mainly). Not sure what language I would be best. Or what the best way to go about it would be. I'm assuming I'd need to make a database of some sort for the files and some kind of UI so I can actually see the pics. Any tutorials or resources to guide me through this?
I know there are a bunch of programs that already do that but I'd like to learn.
I've made a couple python programs to mass download some stuff from mangadex for offline reading. Haven't programmed in the years since cuz I found tachiyomi.
Chani · 2024-07-08 04:22
>>39502
Python with PyQt5, SQLite, and maybe SQLAlchemy would be nice. PyQt5 is dead simple to install, just pip, and would let you setup an easy GUI. SQLite is a SQL interface to editing a file, so you don't need to run a database server, and SQlAlchemy is a nice layer for working with any SQL.
Arisu Mizuki · 2024-07-09 22:43
How do you even pick a language to learn if you don't want to work as a code monkey wage slave for big tech and don't want to be spending all your time learning to code? I know it depends on project but what if you have several vague ideas and am not sure what you will go through with first? What if you dont want to learn every language out there and just want to make stuff for self amusement and for others benefit? Some things im thinking of are Android apps but others desktop more likely for Unix based systems over Windows but possibly some Windows stuff in some cases. Is it better to just learn the languages of open source stuff you can work off of or just learn whatever and work from scratch?
Church · 2024-07-09 23:12
>>39515
For android, you don't really have a choice but to use Java (or another language that targets the JVM). If you want to work off of another project, just use the same language and tools. "Use whatever you like" is only relevant if you start something from scratch
Demeere · 2024-07-10 01:33
>>39516
What if I think a desktop project would possibly either function better or at least just be more pleasant to adapt to my own uses being language migrated from something else than what it was written in? Do you have to fully understand both languages to language migrate or would just the one migrated to while looking up equivalencies line by line and a basic understanding of some of the syntax of the original source code be enough as long as there is development notes explaining what was intended there if there is no one to one match could one write code without fully understanding the original. Which would it be? I could see this going either way.
Neo · 2024-07-10 03:59
>>39517
more reasonable is write a connection between 2 languages and change only what you need in your preferred one.
John Rain · 2024-07-12 07:42
Is there a reasonable way to use `with-slots` across a package boundary?
aliased · 2024-07-12 09:32
If language A and language B do not have FFIs for each other, but both have FFIs to language C, is there any reason why I can't write code in B's C FFI and have it work in A?
Ivan Horvat · 2024-07-12 09:52
>>39530
Generally yes, but the awkwardness of it depends on the language and the implementation of FFI. Even in the worst case, you could probably do it if you write some glue code in C. One of the specific edge cases that comes to mind is if one or more of the languages are garbage collected, since that has some implementation impacts that vary from language to language.
Which languages?
McCarthy · 2024-07-12 09:57
>>39531
>generally yes
Sorry upon rereading your question i realize "generally yes" is misleading. I meant "generally yes you can do that"
Turing · 2024-07-12 15:54
>>39528
To put it another way is there a better way to export a struct than in the picture attached where accessors are explicitly listed, and then employed? Allowing something like ==with-slots== to be used as in the second image?
renames · 2024-07-12 23:57
I was bored decided to go through random C courses just to at least have some idea about the language and what did I find ? Why does this execute with no errors? I thought you had to write more to generate random numbers than just ask to print an integer because I vaguely recall having to do more when I did C++ way back years ago in high school which i remember nothing and here I found if you mix %d and %i together on a print function you get weird results that break from the seeming randomness. If same line most the integers appear as random numbers but some keep the same value then when you do new lines it gets even odder where the integers stay the same every run. If you change it to \t instead you also get different numbers or if you just put in a space you get different numbers that appear same on each run, What even are these numbers representing ? Or is this just because I was using an online C compiler since my computer is out of service? Also I found I can turn the return number to any number and it still runs normal no errors.
#include <stdio.h>
int main()
{
printf("%d,%d,%i,%d,%i\n");
printf("%d\n");
printf("%i\n");
printf("%d");
return 0;
}
Rick Deckard · 2024-07-13 00:13
>>39538
This isn't generating anything. This is technically undefined behaviour, but it is likely printing whatever is in your program's stack.
Tyrell Wellick · 2024-07-13 00:20
>>39539
Okay so just some weird fluke. I guess I really do need to fix one of these broken laptops to try things out on if I am running into things like this using an online C compiler.
Jet Black · 2024-07-14 09:32
>>39541
C doesn't offer any kind of memory protection above what your operating system does, so you can just go out of bounds and read whatever. Your program is "taking advantage" of this by reading random data by not giving it the arguments it expects. The return value of the main function in C tells the operating system whether the program ended normally or not, 0 for normally anything else for not. You can see this by running "echo $?" after the program ends on bash.
Jet Black · 2024-07-14 16:27
>>39551
I see, makes sense. But why does it at some point not be random? That is the weird part that the numbers seem random at first but then some become the same or even repeat themselves. Is the numbers that dont change on each run meaning it is somehow grabbing integers out the ASCII value of the characters in it's own code or grabbing the integers it output or somehow switching to grabbing integers from the online compiler or something? Or am I spending too much time thinking of questions that wont have any practicality knowing?
Fred Nurk · 2024-07-14 18:09
>>39560
I should stress that this is all undefined behavior, so it's up to the compiler to decide what happens, crash your program or keep going.
Let's just look at the last printf for simplicity's sake. printf is a variadic function, so it can take in as many arguments as it needs. The first argument was a format string, that says that the rest of the arguments are going to be one number that should be printed out as a decimal number and that's it. The thing is, you don't actually give it a number. You have to know how function calls are aranged in memory, but it's going to where the number that you should have given it would be in memory, and reading whatever is there instead, and printing it out as a decimal number. Since it's probably a part of the call stack of the printf function, it would make sense that whatever is there would be the same or similar for each function call, but that's entirely up to the compiler. Remember that the code is compiled, so the program that's run is in binary, so it's not pulling out ascii values but the actual bits in memory of the program and printing it out as a decimal number.
This is a really niche issue that only applies to variadic functions like printf because the compiler won't enforce type checking and stuff for functions that take a format string. This is also a terrible coding practice that should never be done in any code, I don't know why they would use this as an example.
C is a very simple language, barely a step above assembly, so this all makes sense if you think about how this would be handled in assembly. It is useful to know about these things if you are writing at a very low level, like bare metal or something, but if you aren't, you should never be in a situation where you have to know this.
Joe Bloggs · 2024-07-22 03:38
>>39562
It wasnt an example used. I just was messing around trying to remove parts to figure out how it works and didnt expect an integer to appear from nowhere undefined and I tested if it also worked with %i not just %d since i was trying to see if they work different. Was just by chance I stumbled on that and it got me curious.
Case · 2024-07-24 02:43
I'm writing a C program with gmpilb and I need to find the product of 1 million integers with an average size of 40 million per number. Currently it's all running in one loop and takes about 30 minutes. Would splitting this into 2 loops and multiplying the 2 results be any quicker? Or would I also need to make it multithreaded?
drop · 2024-07-24 03:15
>>39668
I tested it. Simply splitting it into 2 loops makes it run twice as fast.
Tyrell Wellick · 2024-07-24 06:26
>>39669
That's rather expected.
The product of a n-bit and a m-bit numbers is computed in O(m×n), and occupies m+n bits.
Therefore the product of n m-bit numbers in a single loop will be computed in O(m^n) (and occupy n×m bits)
In your second approach, you computed two partial products in O(m^(n/2)) each (using n×m/2 bits each), and a final product in O(n²×m²), for a final complexity of O(m^(n/2)) (or O(√(m^n))).
In reality, gmplib uses better algorithms for large numbers, but the conclusion would be the same. The ideal way would be to compute your product in a tree-like manner, always keeping operands at a similar size. The overhead of storing intermediate results needs to be accounted for as well, which makes the fastest solution more difficult to find and hardware dependant.
Incognito · 2024-07-26 15:20
>>39670
you've simplified a bit. The product of an n and m bit number is in mlogm+nlogn. The product of n m bit numbers is then in n^2*m*log(nm). So naively we would expect a 4x speedup from splitting the numbers into two groups.
Unknown · 2024-07-28 07:29
>>39668
fork+join model is ideal for this type of task
https://en.wikipedia.org/wiki/Fork%E2%80%93join_model
To avoid overhead of creating threads you could (should) use a threadpool. I haven't used any threadpool lib with C but https://github.com/Pithikos/C-Thread-Pool seems well-suited.
The main thread will parse the input and give work to the threadpool. It should regularly process finished work by accumulating it into the final result.
Leto Atreides I · 2024-07-28 19:12
>>39670
>>39709
This is what I'm doing currently and it takes around 8 minutes (including some preprocessing). I'll have a look at what you two have suggested.
for (int i = 0; i < x; i += 8) {
mpz_mul_ui(product1, product1, primes[i]);
if (i + 1 < x)
mpz_mul_ui(product2, product2, primes[i + 1]);
if (i + 2 < x)
mpz_mul_ui(product3, product3, primes[i + 2]);
if (i + 3 < x)
mpz_mul_ui(product4, product4, primes[i + 3]);
if (i + 4 < x)
mpz_mul_ui(product5, product5, primes[i + 4]);
if (i + 5 < x)
mpz_mul_ui(product6, product6, primes[i + 5]);
if (i + 6 < x)
mpz_mul_ui(product7, product7, primes[i + 6]);
if (i + 7 < x)
mpz_mul_ui(product8, product8, primes[i + 7]);
}
mpz_mul(product1, product2, product1);
mpz_mul(product3, product4, product3);
mpz_mul(product5, product6, product5);
mpz_mul(product7, product8, product7);
mpz_mul(product1, product1, product3);
mpz_mul(product5, product7, product5);
mpz_mul(product1, product5, product1);
Unspecified · 2024-08-13 11:35
Hello Lainons, I have something of a beginner's fear, everyday I'm met with a new concept and it all feels like from behind a glass wall. Like people that are talking about computers are aliens or something.
To fight that feeling I tried to download some books, the linux bible, the nand2tetris book, operating systems by tanenbaum, and a lot of those stuff.
Now my main question is, is this the correct path to take? will I finally understand the computerbro language? I am afraid this path will lead me into nothingness.
dictionary · 2024-08-13 11:57
>>39811
Hello buddy, there's nothing worrying about being a beginner, just keep learning every day, eat the elephant one bite at the time they say.
You can start with nand2tetris, do all the exercises and practice.
I'm a beginner too, I'm currently reading CSAPP and K&R.
Special Agent Bob · 2024-08-14 17:33
I've taken a break from Scheme to get started with C since that moves me closer to my goal of learning C++ and OOP and because SICP started kicking my butt, and while it's far more legible, I'm surprised I'm finding it to be less elegant. I'll continue with my studies with C, but is there a more modern version of LISP?
St. IGNUcius · 2024-08-14 21:11
>>39816
C doesn't get you closer to learning OOP.
If you want to learn OOP, go write in smalltalk (pharo and GT these days are nice), or common lisp.
Common Lisp has the Meta Object Protocol which is quite nice, and there are a lot of nice books for CL.
One thing which scheme doesn't show you, is that a lot of lisps (MIT scheme included) are live systems, and can update live so it gives you a nice environment to play in, which C and it's ilk do not give nicely.
But yeah in general C is not a very elegant or principled language, if you wanted a low level principled language, something like forth is much more "elegant"
Agent Richard Gill · 2024-08-14 21:21
I'm a NEET and need a job. In how many months I can learn basic programming? And then get a basic job? I don't care much about money. I just need 150$ a month and I'll be ballin.
What do?
Trinity · 2024-08-15 01:01
>>39821
Same as the lainon above, although I have some basic experience in programming but I'm in a third world soykafhole, how can I get remote jobs?
Unsigned · 2024-08-15 03:28
>>39816
>but is there a more modern version of LISP?
There are a lot of differences between each Scheme implementation (I recommend that you check out Gerbil, Racket and Chicken). But honestly, I recommend learning Common Lisp instead. Another choice is Clojure if you really like functional programming and the JVM but I think Common Lisp is the best Lisp language.
>>39821
>>39823
Check out the programming employment thread. You can learn Python for free at https://www.mooc.fi/en/courses/
Each course is designed to be completed in about 2-3 months or less. You can decide to complete it in shorter time as it's self-paced. But it has good exercises and optional final exam. You can get course credits at some universities if you complete the course and the final exam (The intro course is worth 5 ECTS).
You should work through both Intro and Advanced Python courses.
>Start with https://programming-24.mooc.fi
After that you should do some projects on Github. I recommend web apps (a textboard and a pastebin service are a good start). You should also try to find out whether meme programming bootcamps are valued by local software companies that are hiring. But note that they don't teach you to be a good programmer and I would go as far as saying that almost all programming bootcamps are useless on their own. The Full Stack MOOC is another option, if you want something different.
You should also learn basics of git version control.
>https://git-scm.com/docs/gittutorial
>https://www.atlassian.com/git/tutorials
>https://learngitbranching.js.org
Demeere · 2024-08-15 15:57
what should I read/learn before going through SICP?
Elliot Alderson · 2024-08-15 21:15
Hallo. The C thread got limit bumps, so I post here to ask a question.
I'm trying to find a way to organize my data (variables, structures) and logic, as a “programming template”. Especially for medium-large projects (I am not necessarily talking about professional projects, but projects made by and for myself.).
In this case, I want to apply a template for a video game. And I have found one. Here is an example:
// particle.h -------------------------------------
typedef struct{
float x;
float y;
} Particle;
// init Particale variables
void InitParticle(Particle*);
// Particle's functs
void Movement(Particle*);
// particle.c -------------------------------------
void InitParticle(Particle* particle){
particle->x = 0;
particle->y = 0;
}
void Movement(Particle* particle){
particle->x += 0.2;
particle->y += 0.2;
}
// main.c -------------------------------------
#include "particle.h"
#include "stdio.h"
int main(void){
int run = 1;
Particle particle;
InitParticle(&particle);
while(run){
Movement(&particle);
printf("x: %f\n", particle.x);
printf("y: %f\n", particle.y);
}
return 0;
}
Is it a good approach or is it bullshit? I read you
The Fin · 2024-08-15 21:45
>>39825
As someone who is close to halfway through it, you should just start reading. The text is very informative and not too difficult to understand, but more than a few of the problems were beyond my present mathematical ability or demanded a surprising amount of effort. Give everything a try, and if you give up on something, look it up and make and try to understand the solution.
Scheme is a very simple, if not the simplest, language to understand while also being incredibly powerful, but it has terrible readability. Get familiar with an editor like nvim. For the interpreter, I’ve just been using the mit-scheme package, but I’ve heard good things about chicken.
Yu-ichi · 2024-08-16 03:32
>>39828
so what would you do if you had to check whether you're on a menu screen instead of the game screen? that's why you'd have all this gameplay-related code in an update function (usually passed with a giant struct of game data) in your game loop, and you first check game state every frame before doing anything else.
fix your sloppy coding style, e.g.
"while(run){" should be "while (run) {"
"typedef struct{" should be "typedef struct {"
other thing to nitpick is i'm not sure if you know that all the major coding styles like K&R, Linux kernel style (based off K&R) and GNU when defining functions place the beginning curly brace in a new line instead of the same line as the function header.
not sure if you know that you can just zero-initalize structs with "Particle particle = {0};" or if you chose to make that InitParticle function for readability reasons.
Hiro Protagonist · 2024-08-16 11:53
>>39831
>so what would you do if you had to check whether you're on a menu screen instead of the game screen?
Data structure holds whatever is active. Simply calling whatever is slotted as active is the way. This also works well for passing input down - ie inputhandlers in a list can address only rebinding whats necessary for a context so regular keybinds continue to work unless explicitly overwritten.
>>39828
visitor & factory pattern are official terms for what you seem to be trying to do.
Ein · 2024-08-17 21:15
>>39831
>so what would you do if you had to check whether you're on a menu screen instead of the game screen?
I though in this silly solution:
typedef enum{
MENU,
GAME
} State;
int main(void){
State state = MENU;
switch(state){
case MENU:
// Menu();
break;
case GAME:
// Game();
break;
}
return 0;
} >that's why you'd have all this gameplay-related code in an update function (usually passed with a giant struct of game data) in your game loop, and you first check game state every frame before doing anything else.
Mhm... could you explain, please?
>other thing to nitpick is i'm not sure if you know that all the major coding styles like K&R, Linux kernel style (based off K&R) and GNU when defining functions place the beginning curly brace in a new line instead of the same line as the function header.
I copied and pasted, for some reason tabs were deleted ¯\(´ー`)/¯
>not sure if you know that you can just zero-initalize structs with "Particle particle = {0};" or if you chose to make that InitParticle function for readability reasons.
Sometimes, I don't want to set all the variables of a struct to 0.
typedef struct {
float x;
float y;
IsMoving;
} Object;
void ObjectInit(Object* obj) {
obj->x = 0;
obj->y = 5;
obj->IsMoving = 1;
} >>39834
>visitor & factory pattern are official terms for what you seem to be trying to do.
thanks bud!
fsociety · 2024-08-20 09:45
Hi Lains. I've never read a book about programming before, I'm interested in learning programming as a hobby. Should I read The Art of Unix Programming by Eric S. Raymond? Any recommendations welcome.
Technician · 2024-08-20 10:28
>>39854
I think to start out it is easier to just dive in and start doing it. Is there a project you'd like to do ? reading books is fine but its so easy to get your feet wet in this hobby
Koos van der Merwe · 2024-08-20 10:38
>>39855
That's my main issue. I think programming is neat but there isn't much that *I* personally want to do right now. I'm looking for ideas and inspiration first.
Drifter · 2024-08-20 10:44
>>39854
Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman. There's a difference between programming and programming well. This teaches the latter.
mitpress.mit.edu/sicp
https://libgen.is/search.php?&req=Structure+and+Interpretation+of+Computer+Programs
Cutter · 2024-08-21 14:45
>>39854
> Any recommendations welcome.
You can learn Python3 for free at https://www.mooc.fi/en/courses/
Later you might want to read SICP, The Art of Unix Programming and other classics.
FILLER · 2024-08-22 18:58
What's the most efficient way to clear the terminal using C? I've heard some methods for clean the terminal.
One of them is calling system("cls"); or system("clear"); , but I've read it's not that efficient.
Another one is printf("\033[H\033[J"); , but this one doesn't actually clear the screen, I understand it just moves all the text to the top of the terminal and sets the cursor position to 1,1 . Question: if I have A LOT of output, does this affect performance in any way? I'm imagining some kind of terminal saturation or something like that.
I'm not that concerned about portability, since my main goal is to work with Windows, but it would be great anyway to use cross-platform methods. For example, Linux.
stack · 2024-08-22 23:30
>>39864
I'm a beginner but I can second this recommendation. I finished this course recently and it was very good. I learned so much! I need to thank the Lainon that linked it in the Python thread.
Neuromancer · 2024-08-23 06:33
>>39867
C has no standard way of clearing the screen on its own.
If you want to use system("clear"); or something similar, you could use the macro preprocessor to test whether we are building for Windows or Linux. You do it like this:
>https://github.com/MidnightCommander/mc/blob/master/src/main.c#L156
>https://sourceforge.net/p/gopherus/code/HEAD/tree/trunk/ui/ui-curse.c#l14
More info: https://blog.kowalczyk.info/article/j/guide-to-predefined-macros-in-c-compilers-gcc-clang-msvc-etc..html
But!
There are better ways to do this than using system() On *NIX you can use terminal escape codes. The other alternative is to use ncurses (but it's complex). On Windows there is a function to do this but it's specific to Windows. I can't remember if clrscr() is the correct func to use or whether there is a newer function? Anyways, you can make clrscr() portable to *NIX by using testing if you're building on Linux, and then you can supply your own implementation of clrscr() that uses terminal escape sequences: \E[H\E[2J I copied it from st source code.
Also, see https://linuxcommand.org/lc3_adv_tput.php
>Question: if I have A LOT of output, does this affect performance in any way?
You don't need to clear the screen because of any performance reasons. The only reason to do it, is to make the program output more readable for users.
Incognito · 2024-08-23 08:55
What's a good book for learning network programming in C? "Hands-On Network Programming with C" seems to have mixed reviews, but I'm thinking of starting here if nobody has better suggestions
Marly Krushkhova · 2024-08-23 13:20
>>39870
ty :D!!
>You don't need to clear the screen because of any performance reasons. The only reason to do it, is to make the program output more readable for users.
I understand. Talking about terminal escape sequences, see the next code
#include <stdio.h>
int main()
{
int c = 0;
// loop
while(1)
{
// input
scanf("%d", &c);
// it "cleans" the terminal
printf("\E[H\E[2J");
// options
switch(c)
{
case 1: // it prints "Hello"
printf("Hello\n");
break;
case 2: // it prints "Nice to meet you"
printf("Nice to meet you\n");
break;
case 3: // it prints "What's your name?"
printf("What's your name?\n");
break;
}
}
return 0;
} Suppose I select any option MANY times (100 times, 500 times, 1000 times, even 5000 times...), what would happen?
Drano · 2024-08-24 15:00
Are there any good resources on backend web development without frameworks? I'd like to get a somewhat lower level understanding of what all these frameworks and libraries are actually doing and abstracting away. Any language is fine.
Gyula Kovacs · 2024-08-24 15:10
>>39879
For protocols themselves MDN is good, e.g. https://developer.mozilla.org/en-US/docs/Web/HTTP
Making a simple HTTP server from scratch should be easy, but if you're interested in how to handle many requests concurrently then it's probably best to look at what the OS provides.
For UNIX systems there's poll() and select().
On Linux you'll want to look at epoll() and io_uring. FreeBSD has kqueue().
No idea about other OSes.
cdr · 2024-08-25 09:58
>>39871
Firstly, you need to learn the TCP/IP protocols and the OSI model. You can use 1 of these books: https://dpaste.org/tJjHM
There are also TCP/IP illustrated volumes 2 and 3 and Internetworking with TCP/IP volumes 2 and 3, Vol 2 of both books describes old implementations of TCP/IP stack, and vol 3 of both books teaches network application programming. The vol 3 (and especially vol 1) of both of either one of these books is more relevant than vol 2. However, I suggest starting with this ---> https://beej.us/guide/bgnet/
>>39873
Terminal scrollback is not unlimited. Over time it gets overwritten (it depends on your settings). You can make a test program that has infinite loop that just executes printf("hello world\n"); You can then use htop or xfce4-taskmanager to check the memory usage of your program and your terminal emulator.
Also, there is output buffer that get filled every time when you printf() something. Nothing is actually printed to screen before the buffer is full or it gets flushed. Similarly, scanf() also uses input buffer. You need to read about buffered output and buffered input to properly understand this. If you want to make sure that stuff gets actually printed to the screen when you expect it to get printed, you need to flush the buffer. That's what std::endln does in C++ (in addition to sending \n char). In C, you need to either print a \n char (it can be at end of any printf() statement) or you can use fflush(stdout) You can also disable buffering (in that case, read about setvbuf() function but note that you generally don't want this!). And you can generally assume that all I/O is buffered, unless noted otherwise.. It's a bit complicated but you will understand it. Using a buffer is important optimization technique but if you are programming a game then you will want to use unbuffered I/O, since you want to use that user input immediately.
Also, a tip: you can use scanf() when you want to get only 1 word string but it's better to use fgets() to get whole lines of text (I prefer to always use fgets() function). scanf() will have security problems, unless you take them into account. But you should ignore that for now. But be sure to read about it before you start making real program, though! In fact, string handling in C is full of pitfalls. Here is a good article: https://sekrit.de/webdocs/c/beginners-guide-away-from-scanf.html
But you can ignore it for now!
Roy Batty · 2024-08-29 10:21
Why do we need appimage if we can statically link programs? Both already need to include the a copy of the libraries inside them, it's only for the sandbox?
The Fin · 2024-08-29 16:18
>>39901
glibc (GNU C Library) is among the main problems with maintaining backwards and cross-distro compatibility with Linux programs, regardless of whether it's statically linked or packed in an AppImage. You're still going to have problems in the future distro versions. From the top of my head I know for example the native statically-linked Linux version of Neverwinter Nights (2002) does not run on modern distros due to their older version of glibc they built against being unable to interact with some basic system calls and the ext4 filesystem which came out 2006. In order for backwards/cross-distro compatibility to be a reality for Linux someone needs to come up with a much more limited sandboxed environment than AppImages that is immune to the frequent changes of glibc, sound servers, new filesystems, paths to OpenGL libraries, etc.
byte · 2024-08-30 08:44
Just wrote this
#include <stdio.h>
int main() {
// printf() displays the string inside quotation
printf("Hello, World!");
return 0;
}
Meddler · 2024-08-31 04:22
I borked my gtk3 install trying to compile dudemanguy's patched file chooser on Debian :(
I got the gtk2 version working successfully though
The Plague · 2024-09-02 07:46
Where can I find a comprehensive introduction to practical programming basics? Why/how are programs split into multiple files? How does FFI work? That kind of thing. I don't mean philosophical concepts like what is a variable or what is a loop.
藤原純一 · 2024-09-03 00:41
hi. is this intended rendering or an android bug? svg.
<text x="0" y="50" stroke="white" stroke-width="1" fill="none">soykaf</text> looks cool but i wanted a plain simple stroke.
Pulse · 2024-09-03 06:05
>>39917
its correct. Since you have fill=none it only renders the borders which allows borders to render inside other elements. Change fill to background color if you want plain look
stack · 2024-09-03 07:52
>>39903
Welcome to c. I'd suggest reading the printf man page to understand the nuances of it (format strings, format string exploits)
Hitomi · 2024-09-04 13:57
Anyone used freebsd?
Thinking of making a server from old laptop and i heard its more robust than linux. Would be interested if anyone can share their experience with it.
Moore · 2024-09-05 12:56
>>39923
making your own version of bsd instead
push · 2024-09-06 09:51
>>39923
>Thinking of making a server from old laptop and i heard FreeBSD is more robust than linux. Would be interested if anyone can share their experience with it.
I have briefly used it in the past (i even contributed patch to ports) but honestly I wouldn't recommend it unless you want jails or zfs. ZFS needs a lot of RAM, so using it is probably out of the question. Second, if you want to choose a *BSD because of security, you should only consider HardenedBSD or OpenBSD. I don't have any personal experiences with using HardenedBSD and it's much smaller than the rest of *BSD distros. OpenBSD is great but it has worse performance than FreeBSD or Linux. The BSD ports system is kinda nice if you like old school Unix way of doing things but honestly Gentoo's portage is way better since it's more convenient but just as powerful. I'm not saying that FreeBSD or some other *BSD is not good for servers but honestly I prefer GNU/Linux. I don't see any reason why I would use a *BSD over Linux since OpenZFS is good and it works on Linux, and Linux does almost everything else better. except that sndio or OSS is much better than ALSA I recommend against using btrfs but it probably has improved from the last time I checked it. You need to read the btrfs docs and check out which features can cause trouble (trouble can mean "data loss" in the case of a file system!)
But as I said, ZFS has issues if you don't have a lot of RAM. In that case just using ext4 is likely good enough for your needs (it certainly is good for my needs). You can add LVM if you want snapshots but you need to set up other backup mechanism. For more details see, >>>/Ω/79324
Since we are talking about a server, I would honestly just use Debian or Devuan (with OpenRC), instead of using any *BSD operating system. I would also set up automatic security upgrades. If you are the only person who access your server, you should block all incoming traffic outside of your LAN. You might also be interested this article: https://vermaden.wordpress.com/freebsd-desktop/
Set up a VM and play around. Note that all familiar looking utilities (fdisk, make, etc.) behave completely differently than their GNU counterparts!
Debbie Charteris · 2024-09-06 13:19
>>39968
HardenedBSD from what ive heard is ran by people who dont know what they are doing unlike OpenBSD. ZFS only uses 1gb per 1TB of storage so only an issue if it is a large storage or very low ram. You also can reduce it's memory usage but im unclear how this works.
>>39923
DragonFlyBSD would in theory possibly provide better up times from being a hybrid kernel.
Technician · 2024-09-06 21:21
>>39923
You heard wrong. Use debian stable.
Leto Atreides I · 2024-09-10 12:34
>>39923
Better TCP/IP stack and better multiprocessors processes balancing scheduler. Dunno how IO scheduler compares.
>>39975
Dragonfly is an unstable hot mess in development
OpenBSD is lagging behind due to constant rewrites for the sake of rewrites masked as "muh security 1st"
queue · 2024-09-12 11:40
>>39902
Linux has a stable syscall ABI and only very rarely remove any, so it's highly unusual if an old program breaks due to a missing syscall. See https://www.kernel.org/doc/Documentation/ABI/stable/syscalls:
>This interface matches much of the POSIX interface and is based on it and other Unix based interfaces.
>It will only be added to over time, and not have things removed from it.
And besides, if it's actually statically linked it shouldn't rely on glibc at all.
glibc is a very real issue when it comes to portability though. Had someone build a program on their desktop, then try and fail to run it on another due to different glibc version.
This makes statically linking a better option for portability on Linux actually.
Cutter · 2024-09-13 11:16
>>39975
HardenedBSD is run by defcon pseuds who literally do not know what they are doing.
Want proof? browse their forum.
https://forum.defcon.org/node/236100
doracake · 2024-09-14 13:01
im looking for some good books and tutorial for web development. My air is become Forntend Developer.
Trinity · 2024-09-14 13:41
>>40045
Learn HTML+CSS at W3Schools first. Note that all other tutorials on that site is like kicking dead whales down the beach. You can host your personal homepage for free at NeoCities (it's a good exercise). Pls also join the Lainchan community webring. You can find more resources at these two sites:
>https://www.theodinproject.com/paths/full-stack-javascript
>https://fullstackopen.com/en/
Neo · 2024-09-17 20:25
Should I make my own self hosted captcha or should I use big google captcha service or similar stuff?
I hate the idea of using another company software, especially if not open source or free.
Do you think it's difficult to make a decent captcha to prevent spam?
Lord Nikon · 2024-09-18 00:41
>>40057
You can get a captcha from hcaptcha, too, if you want to avoid Google. But implementing your own captcha that's also effective is not easy. I would suggest using mkproof as your captcha if you want something that's open source.
>https://git.sr.ht/~sircmpwn/mkproof
Lady 3Jane.. · 2024-09-18 03:58
>>40058
I'm going to try this I think: https://github.com/adrsch/slider-captcha
If I fail, I will use hCaptcha I suppose...
Turing · 2024-09-18 05:12
>40057
Making your own captcha that's reasonably effective is easy. It won't stop a truly dedicated spammer but you can switch to a commercial captcha if that ever happens. Whatever the case, only use recaptcha if you hate your users.
Colmerauer · 2024-09-18 16:49
>>40064
>It won't stop a truly dedicated spammer
That actually brings up an interesting point. The goal of a captcha, and similar antispam measures, isn't to stop spammers outright, but rather to put obstacles in their way so they're easier to deal with.
St. IGNUcius · 2024-09-18 17:31
>>40064
That is precisely the conclusion I came to. A truly dedicated spammer could bypass my own DIY captcha. But it's low probability that I attract such a dedicated enemy.
If it would happen, then I would try to ban his ip, and if it is not enough, then I would hire a commercial captcha like hCaptcha.
byte · 2024-09-18 19:10
>>40057
What kind of captchas you can use also depends on the type of content you host.
e.g. osdev.org uses custom questions with answers you can find on the wiki, which you then enter into a text field. It can be bypassed by someone who is dedicated enough to find answers for all possible questions but non-trivial to automate otherwise.
Unsigned · 2024-09-29 19:03
why does messageboxa require 40 bytes of stack to work? if i remove the first line, the dialog doesn't appear. win32 x86_64 fasm.
sub rsp,8*5
mov r9d,0
lea r8,[_caption]
lea rdx,[_message]
xor rcx,rcx
call [MessageBoxA]
SHODAN · 2024-09-29 19:12
>>40102
adding. debugger shows the function doesn't make use of that space, which can only be 40 bytes not less. so something to do with alignment?
J.C. Denton · 2024-09-30 08:12
Video tutorials are worthless
My mistake is watching too much video tutorials, they are meaningless. All i do is blindly follow their steps, at the end all i have is a copy of what they make, since i pause and copy their code every 2 seconds. There is no learning, i didn't struggle, make mistakes, do research, read the docs,.... i watch more than i type. Dont make the same mistakes as me, all video tutorials are worthless, just like college lectures. A waste of my fuarrrking time and it makes you lazy.
you can't remember anything if you just do it once, and if you want to go back practice your material, video tutorials are fuarrrking trash at this. Imagine not being able to just ctrl f search for a keyword and have to click click click until you come back to the specific time. Worthless
Crash Override · 2024-09-30 14:14
i am very new here (and to imageboards as well)! im just new to technology in general..
i was wondering if anyone has any good places to start? i know some C# and HTML/CSS but that is it!
give me any suggestions at all! im fine with anything! but i am kinda scared of linux.. (i am stupid)
Unidentified · 2024-09-30 15:08
>>40105
For OS tinkering:
Hotboot linux mint off a flashdrive or CD
>inb4 mint 2 big
run puppy linux. it works well enough for the very, very basics.
You can try dualbooting, I used to do it but after a while it is easier just to mainline linux. Here is a handy tutorial on how to mainline Linux properly: https://www.yewtu.be/watch?v=-tcfQQPQHL8 - note that your flashdrive-needle may be larger than hers, so you may experience additional discomfort.
For learning to program:
Pick something you want to do, and do it.
Make a utility for something.
Make a simple game.
Make a simple bot for a game.
Make a simple website.
Make a simple web-crawler.
etc...
I'd switch to linux sooner than later, kind of a pain to work on windoze or zapple after a while.
For learning to program "fancily" (do this after you learn to do a lot of small things for yourself):
Find a publicly available course in functional programming (OCaml is what I learned but other languages work). Most MIT courses are good, I dunno if they have one in functional programming.
Otto Normalverbraucher · 2024-09-30 15:38
>>40102
home space? it's the first thing that comes to mind.
John Rain · 2024-09-30 16:19
>>40102
Your debugger might have an option to trap access to certain memory regions.
I don't know the win32 (or whatever) ABI, but at least with x86_64 SysV ABI stack space is reserved if the return argument doesn't fit in rax and rdx. Although rsp is first moved into rax as a pointer, which isn't happening here. It should be easy enough to recover the pointer in the callee though, so I'd check the code for whatever function [MessageBoxA] points to.
Molly Millions · 2024-09-30 16:26
>>40108
>Although rsp is first moved into rax as a pointer
Apparently the pointer is stored in rdi, not rax, by the caller. Just checked with gcc. Though it is moved into rax by the callee (which is rather pointless IMO).
Neo · 2024-09-30 16:39
What's a good Linux distro for a 2003 laptop with like 500 MBs of RAM and less than a couple GB of storage? I just want to be able to browse the web and play retro games.
Anamika · 2024-09-30 22:09
>>40110
You might be able to get by with a custom debian install. LXQt is a good desktop environment, but you might want to try a simple window manager like dwm or i3.
If you don't mind using an older OS, lubuntu might be easier. 18.04 is the last version supporting 32bit systems. (I've used it on a laptop with specs similar to yours before support was dropped)
In any case, don't expect it to work like a modern system. Most things will be slow and you won't watch videos on youtube (but there are other solutions).
Emmanuel · 2024-10-02 10:00
>>40110
I would choose Puppy Linux or TinyCore (I prefer TinyCore out of these 2). I recommend using a simple WM (examples: dwm, i3, Ratpoison, FVWM, cwm). You could try if Dillo or NetSurf works, if you want. But it's not realistic because you can't browse modern sites, since all modern browsers are too heavy for that laptop. If you are looking for some alternatives, then you could use a Raspeberry Pi for your purposes. Getting used business laptop (preferably Lenovo Thinkpad, Dell Latitude or HP Probook/Elitebook) is recommended if you have the money.
drop · 2024-10-12 08:20
>>40107
>>40108
figured it out. that space isn't used (breakpoints weren't triggered) so somehow it's the alignment. messageboxa requires the stack to be 16-byte-aligned otherwise it throws memory access exceptions.
Turing · 2024-10-13 00:16
>>40110
You could give Damn Small Linux (DSL) a shot.
https://damnsmalllinux.org/wiki/minimum_hardware_requirements.html
Meddler · 2024-10-26 04:52
What is the compiled equivalent of perl, in that a 'quirky' language with less users? I was thinking dart (excluding flutter of course). Learning such languages is much more fun than your usual js or python.
Marly Krushkhova · 2024-10-29 16:42
>>40264
Try Haskell. Off the top of my head, I can't think of a single compiled language more different from mainstream compiled languages than it. Even next to other functional languages it's an odd duck. It's also powerful and flexible in a way that'll probably appeal to you if you like Perl.
Anamika · 2024-10-30 00:54
>>40264
Free Pascal, FreeBasic, Delphi.
Agent Richard Gill · 2024-11-07 06:01
What do I learn from learning Haskell? Should I learn OCaml instead? I want to learn functional programming and I was thinking about learning one of these 2 langs.
Nobody important · 2024-11-07 06:28
>>40360
>What do I learn from learning Haskell?
You learn how easily is to blow up all memory on your system, since haskell copies data like it has infinite memory.
You should learn OCaml instead, it is far more pragmatic and practical.
GIL Foil · 2024-11-07 11:26
>>40360
>>40362
OCaml is good for a beginner as a start at ML like family of langs.
But the more important than the lang itself is understanding of reasons WHY you want to learn IT and HOW you want to apply your knowledge.
And the second most important thing is picking a good well explained tutorial, guidebook.
>>40264
c, nim, vlang, raku?
there are no compiled equivalent of perl, AFAIK, you could try to email that question to ActiveState support.