[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: Future.jpg (118 KB, 1024x988)
118 KB
118 KB JPG
What are you maids working on?

Last thread: >>107542891
>>
A bash script that gracefully shuts down my Minecraft server on SIGTERM.
>>
Mainly trying to get out of the maid agreement
>>
>>107575071
File Manager for TempleOS
>>
>>107575071
Ugh, another thread ruined by degenerates
>>
>>107575489
I'm going to be completely honest homie, I still have no idea how linker script works - seems quite weird. I cheated and inlined the syscalls directly into the main function and eschewed the _start completely by making main the entry point. Got down to 504 bytes using your linker script:

#define SYS_write 1
#define SYS_exit 60
const char message[] = "Hello, world!\n";

void main(void)
{
asm("xor rbp, rbp");
asm("syscall"
:
: "r"(SYS_write), "r"(1), "r"(message), "r"(sizeof(message) - 1));
asm("syscall" : : "r"(SYS_exit), "r"(0));
}


and the same old invocations as last time + your linker script:
clang -s -static -Os -masm=intel -nolibc -nostdlib -Wl,-n,-T,linkerscript.ld -fno-ident -fno-asynchronous-unwind-tables -o nolibc.out nolibc.c
>>
>>107575624
Yeah, another unoriginal Discord troon thread.
>>
>>107575655
Nice.
I think that's as good as you're gonna get while still using a compiler, and certainly good enough. If you were going for "absolute smallest hello world" for memes, you can beat it by making the ELF file yourself with a hex editor or assembler but that's a waste of time. People have already gotten it as small as possible:
https://github.com/Arhoc/76-byte-hello-world
https://github.com/cj1128/tiny-x64-helloworld
>>
>>107575722
Thank you for the links - will read up on them for fun.

Tbh the impetus for all of this was just figuring out why the Rust version seemed to be smaller than the C version, both having -O3 esque optimisations applied.

Exploring the compiler options, and knowing layout of the ELF binary the C compiler made could be improved has definitely assuaged a lot of my doubts. There's probably an option in gcc to turn off those .note sections tbf.
>>
how do i learn x86 asm?
>>
File: sss-5x56.png (773 KB, 1653x850)
773 KB
773 KB PNG
You should write something in Forth, Anon.
>>
is it fine to use lambdas to compute stuff when you want your variables to be const? the two functions below seem to compile to the same thing with -O3.

double sum_array(const double* a, const int s) {
double sum = 0;
for(int i = 0; i < s; ++i){
sum += a[i];
}
return sum;
}

#include <functional>
double sum_array2(const double* a, const int s) {
const double sum = [a, s](){
double sum = 0;
for(int i = 0; i < s; ++i){
sum += a[i];
}
return sum;
}();
return sum;
}
>>
>>107575811
why do you have to make every thread about this """"""""""languag"""""""""
>>
>>107576531
No, that's ridiculous
>>
>>107576619
why is it ridiculous? obviously the only relevant part of the example is the loop computing the sum. sum_array and sum_array2 are there just so godbolt will compile it.
having sum as a const is much better than not.
>>
>>107576642
>having sum as a const is much better than not.
Why do you think this?
Having the lambda makes your code unnecessarily complicated for little benefit. If nothing else, more typing for the exact same machine code.
If you really want to break it out, make it into a new function.
>>
>>107576703
>Why do you think this?
because it gives you a compile time guarantee that you will not change its value by mistake. saying "just don't fuck up" is not an argument.
>make it into a new function
now that is more complicated for little benefit. the lambda makes it compact and inline. all the code stays within your view.
>>
I am sick of seeing this NOT BLOOD RELATED in the catalog
>>
>>107576531
write the code you want. optimizers only do a limited amount of work. when the function is small, they can figure out how to turn the code you wrote into the code you want. as the function grows, the amount of work required goes up, until it crosses a threshold beyond which the optimizer gives up. and performance goes to the shitter. so write code that is as close as possible to what you expect the optimizer to gen. deviations should only be for extremely local things. eg you don't have to write your divs by a constant as muls and shifts, the optimizer can always figure that out. but if the constant gets passes a million times as a variable assume the optimizer won't be able to figure out it's a constant and act accordingly.
>>
I have a private EC2 instance that can ping a NAT instance, but not the internet.

Any idea what I'm doing wrong? My route tables all look correct.
>>
>>107576750
Then it sounds like you know enough to not ask /g/ for advice.
>>
File: images(3).jpg (16 KB, 400x308)
16 KB
16 KB JPG
>>107575655
>xor rbp, rbp
>>
>>107577787
Compilers like to emit that often too for whatever reason.
>>
>>107577942
maybe you're just retarded because that doesn't happen on my machine
>>
>>107577942
that doesn't mean you need to add it everywhere
it's to break dependencies it just zeroes the register
>>
>>107576750
>because it gives you a compile time guarantee that you will not change its value by mistake
There is no guarantee, because you just translocated the problem to the body of another function. Use a fold over iterators, not a fucking for loop. All you've done here is make a mess.

All the compile time guarantees in the world won't fix dogshit organizational skills.
>>
>>107578416
rbp is a frame pointer and has nothing to do with what you just hallucinated.
>>
>>107578592
maybe read what posts are replying to before replying
>>
>>107578646
I assumed that you were replying to bait but now I know that you're a samefag, thanks for info.
>>
What is the point of this thread when AI can do everything?
>>
>>107578978
What is the point of people when AI can do everything. Just get rid of people.
>>
>>107578978
the only people who think AI can do anything are nocoder retards

there is not a single company in the world that has actually replaced a paid programmer with an AI. Its a common misunderstanding however since the programmer bubble burst at the same time as AI gained prevalence. However those of us who know, know that it actually had nothing to do with eachother.
>>
>>107578991
The lack of jobs says otherwisee.
>>
>>107579034
There's plenty of jobs.
>>
>>107579054
Yep, though only for senior engineers
>>
>>107579084
Mcdonalds is waiting.
>>
>>107577942
Prove it. They emit "xor ebp, ebp" because it does the same thing with less machine code.
>>
>>107579034
thats the buble i was talking about that bursted. Over the past like 2-3 decades or so there was such an insane demand for programmers and every company was fully bottlenecked by their devteams. This was the era when people went from being a janitor with 0 education to learning basic html and then landing a 100k job at some tech company. During these years there was a massive influx from people across every industry as well as universities started shitting out ever greater amount of software engineers every year. I would say around 2016 the natural supply met the natural demand however since we had just been in such a long draught companies kept hiring more and more just to be safe. During this time companies programmer departmenst absolutely ballooned (e.g: twitter having 100s of employes doing fuck all).

What happened around 2020-2022 when AI gained prevalance is some companies tried downsizing their programmer departments and realized that they faced 0 consequences doing so, creating a trend amongst all companies. All of the sudden thousands of experienced programmers fluttered the market in a time when universities were exporting an all time high as well. This lead us to the situation we are in now, nothing to do with AI.

Pherhabs AI is what caused those initial companies to try downsizing, however its not like these companies that went from ~400 devs to 25 became 25 programmers and 375 AI agents. Its just 25 programmers.
>>
File: file.png (1.55 MB, 1377x887)
1.55 MB
1.55 MB PNG
*pill me on golang. ive chosen it for my cursed project of driving a weact 0.96" display on a raspi zero because building for arm is as simple as
GOOS=linux GOARCH=arm64 go build -o "${TMP_DIR}/main" main.go
and thats as much thought as i care to put into writing bash build scripts (i will NEVER learn cmake or similar because fuck that). c and rust were exponentially more annoying to build to the point where i dont ever want to use rust for anything ever. why dont language developers bother writing straight forward documentation for cross compiling their language? just tell me what libraries and flags i need.

but go is annoying. it flaunts itself as typed python with braces but its really just c in a trenchcoat and no clothes underneath. the amount of casting needed for stuff is simultaneously a sobering come-to-jesus moment for my avoiding typed languages and absolutely fucking retarded.

the tooling is dogshit. thank you compiler, i definitely know what +0xa4 means. modules/packages are annoying but i think i just need to sit through it for a few thousand more loc and "get it". string manipulation is awful. file writing is awful. honestly the ergonomics are not pleasant.
>>
how do i start improving
how to i exit this malaise im currently in?
>>
>>107579208
Just call this function in real life.
[[noreturn]] static inline void exit(i32 const status) {
register __auto_type arg0 asm("rax") = __NR_exit;
register __auto_type arg1 asm("rdi") = status;
asm volatile ("syscall" : : "r"(arg0), "r"(arg1));
__builtin_unreachable();
}
>>
>>107579242
i just need to pick something and focus my efforts on it but everything just sucks so much and im scared of failure
its so fucking over bros
>>
File: 1520080180786.jpg (48 KB, 900x400)
48 KB
48 KB JPG
>>107579359
>im scared of failure
Failing is how you improve.
>>
>>107579359
Pick up a shotgun and focus really hard on poiting it at the middle of your brain from inside your mouth then pull the trigger. Failure is not an option.
>>
>>107575900
nandgame.com
>>
>>107576610
are you having an aneurysm?
do you need medical help?
>>
>>107579208
nandgame.com
>>
>>107579796
This looks like fun.
>>
in shannon coding why exactly does taking -log(p_x) bits from the cumulative probability yield a unique prefix code? couldn't it be the case the the first n bits yield a non uniquely identifiable code?
>>
>>107579796
>>107579824
I don't know of to think to solve these problems in a structured intelligent way. I just try random things until something works.
>>
File: out.mp4 (2.9 MB, 720x1280)
2.9 MB
2.9 MB MP4
>>107579133
>c and rust were exponentially more annoying to build to the point where i dont ever want to use rust for anything ever. why dont language developers bother writing straight forward documentation for cross compiling their language? just tell me what libraries and flags i need.
https://rust-lang.github.io/rustup/cross-compilation.html
https://docs.rust-embedded.org/book/
https://pico.implrust.com/
https://docs.espressif.com/projects/rust/book/

What issues did you actually had cross compiling Rust? From all the compiled languages I have used, Rust seems to have the most straightforward cross compilation process out there.
>>
tomorrow im going to wake up and and im gonna do something
but im not sure what
>>
>>107580913
wank
>>
>>107580913
destroy the global slave system?
>>
>>107579208
you do what you can
>>
>>107581414
>>107581248
>>107581015
no i mean programming-related something so i can improve as programmer and find a better job
>>
which GUI bindings do I make for a niche language that has C FFI?
I guess tcl/tk might be easiest.
>>
File: 1744332772320404.jpg (6 KB, 201x251)
6 KB
6 KB JPG
>>107580913
>>
>>107581444
>and find a better job
has literally nothing to do with skill at programming
>>
File: 1748179254166715.png (69 KB, 757x489)
69 KB
69 KB PNG
.
>>
Woohoo, I just invented op codes!
>>
>>107582997
disaster waiting to happen
>>
>>107583103
Does it crash always or only sometimes, like 41% of the time?
>>
>>107575071
Wtf is mad outfit?
>>
>>107583240
Only thing that crashes is my brain. I get frustrated and close the game and like 30 seconds later I open it up again.
>>
File: file.png (92 KB, 951x893)
92 KB
92 KB PNG
making a recursive macro processor for C

how many of them exist in the wild? it seems like a huge cheat
>>
File: file.png (93 KB, 963x917)
93 KB
93 KB PNG
>>107583379
better pic
>>
What's a boomer loop?
>>
File: graph.png (185 KB, 1438x902)
185 KB
185 KB PNG
>>107575071
Made a 4chan post graph visualizer
https://4graphs.netlify.app/
>>
>>107583379
Is that m4 or something?


You can do recursive macros
https://github.com/swansontec/map-macro/blob/master/map.h

Never tried this but it seems pretty extensive
https://github.com/hirrolot/metalang99
>>
>>107576808
It's been ages since i had an EC2, just used it as a webserver. Retard speculation, but maybe they drop some kinds of outbound packets by default until you pay extra?
>>
>>107583524
for (int i = 0; i < n; ++i) { ... }
in contrast to the
Modern C++ practices safe and effective loop
std::algorithm(std::iota, std::increment, std::increasor, std::with_function(std::function, std::arguments))
>>
>>107583623
I don't think that should be happening. The one in the public subnet worked. I was also following a tutorial and did it over 3 times exactly and am still having this issue.
>>
>>107583629
I'm not sure if this is meant ironically.
>>
>>107583724
I'm afraid it probably isn't
>>
>>107583555
>Is that m4 or something?
No it's written from scratch in C. I'm prett use it's quite different from m4. I tried to followed the macro expansion of Lisp.
The kinds of definitions are $define $var {...} and $define @func($param1, $param2) {...}.

When it sees $var where $var has been defined previously, it recursively macro expand the string value of $var and insert it into the new built string.

When it seens @func(float, if (a == b) { printf("%d", a); }, func()) where @func($param1, $param2, $param3) has been defined previously, it extracts the arguments and do so in way that nested constructed are selected properly. It recursively macro expand each argument (I discovered I need to do this, otherwise my example in pic rel would do an infinite loop, trying to expand "$name"), then binds each expanded argument to each corresponding parameter name (the number of parameters and arguments must be equal), then it recursively macro expands the body of @func and insert it inot the built string.
After the expansion of a macro call, the previous environment is restored. For example is $param1 was already bound before doing the macro call, it will be restored to its old value.

I'm going to add a couple of things next, $ifdef and add a second form of macro expansion (which will be the default) that will remove any macro statatemnt (such as $define) from the expansion.
>>
Has sticking to C like a purist ever gave you something in life?
>>
>>107584360
No, I tried that once. Embrace sepples.
>>
>>107584360
There are no good alternative.
>>
>>107575655
I think xor ebp, ebp should be 1 byte less but still zero out the whole 64 bit.
>>
>>107584360
I decided to focus my studies on learning C++, and then when I got a job nobody wanted me to write C++. And the few times I got the opportunity everyone was pissed at me in code reviews for not sticking to the C subset.
>>
>>107583379
The C preprocessor can already do this.

// array_def.h

struct ARRAY() {
ARRAY(_elem) *array;
size_t length;
size_t capacity;
}

void ARRAY(_init)(ARRAY() *array, size_t capacity) {
array->array = malloc(capacity * sizeof(ARRAY());
array->length = 0;
array_capacity = capacity;
}

#undef ARRAY

// ----------

#define ARRAY(NAME) array_u8 ## NAME
typedef uint8_t array_u8_elem;
#include <array_def.h>
// expands into precisely the same code.
>>
>>107584718
You missed the point of the example. It's not about what code it generates but how it generates it.
With C macros you can call a macro inside a macro but it's extremely fragile (escaping newlines) and you have to put the declaration in the right order because it's not a true macro call inside a macro, it's that the macro call happens at definition time.
>>
File: prog1.png (1.29 MB, 5120x1440)
1.29 MB
1.29 MB PNG
>>107575071
Got carried away building a personal dashboard app with an Android companion.
The Dashboard (Web) Displays on any device - it's just a website.
Users can have multiple dashboards and set per-device defaults.
Originally started with just meetings, tasks, and time, and has now evolved into something much larger and potentially more useless.
Dashboards are widget-powered: tasks, calendars, timers, weather, video/music players, webviews, and integrations like Home Assistant for toggling entities and querying server state.
There's a built-in editor for tweaking layout and styling.
Themes are a thing I maybe spent too much time on. Currently there's a persona-inspired style and Windows 98, both fully custom CSS—the Win98 doesn't use the common libraries floating around. Every widget has to support every theme or I don't consider adding it.
Desktop mode lets you click Start for an actual desktop-like environment when using a desktop theme. The Android App Communicates with an API I built to translate natural language into dashboard actions. Voice input via on-device Whisper or OpenAI, plus chat.
Commands go through pattern matching and when needed an LLM (OpenAI-compatible) with context-aware branching depending on the task. "I need milk" adds milk to the grocery list. "1:1 meeting at 3 tomorrow" schedules it in your work calendar. "Don't jump vs ryu" adds a note to your sf6_training notes. "Start a 30 second timer" does what you'd expect.
There's also an admin panel for managing things the old-fashioned way, and push notifications for due tasks, expired timers, etc. Planned: Bidirectional Google Calendar sync and more integrations.
>>
File: sshadd.png (104 KB, 1998x669)
104 KB
104 KB PNG
>>107585573
sorry for double post
Just added an ssh widget

This really is just for learning and my own productivity but I'm wondering if this has any potential at all to be useful to anyone else?
>>
>>107579084
there are plenty of jobs for competent people
if you didn't start programming for fun when you were prepubescent you're ngmi
>>
File: 3bit_adder.png (134 KB, 1423x800)
134 KB
134 KB PNG
I wish they'd give more vertical space so you could better visualise the nodes in purely ascending order.
Almost looks like a neural network if you squint.
>>
File: out33.mp4 (1.76 MB, 1328x592)
1.76 MB
1.76 MB MP4
I'm making my own simple MS Paint kind of program in Tcl/Tk. I just finished implementing and polishing the flood fill.
>>
>>107586779
Cool! That's one of the things I'd like to do that I'll never get around to doing.
>>
>>107583379
It would be neat if it could also generate a _Generic expression, which the C preprocessor can't really do easily.
>>
>>107586660
Neat.

I'm still stuck on problem 1.
>>
>>107588116
Building a NAND gate out of transistors?
>>
>>107575618
you should add a margin to the contents pane so they don't render over the column names when scrolling
>>
>>107575618
what filesystem does templeos even use? did terry invent his own divine one?
>>
>>107586779
Very cool
But next time make your own gui toolkit
>>
>>107586779
surely the "fill animation" is intended and not a byproduct of the program being super slow right?
>Tcl/Tk
nm
>>
>>107590606
Give the guy some slack. It's obviously a hobby program just for fun. It doesn't have to be super optimised.
He just made it work. Optimisations come later if it turns out to be too slow for comfort.
>>
>>107590606
It's probably impressive that it's as fast as it is, assuming the fill algorithm is implemented in pure tcl.
>>
>>107586492
>there are plenty of jobs for competent people
Suicide booths for the rest of us when?
>>
>>107579796
Holy kek I'm really bad at this, I didn't even realize the relays were and and not gates until I clicked on the hint. My compsci degree has failed me.
>>
Do you guys have any lesser known programming-focussed youtube channels you like?
For me, it's https://www.youtube.com/@perlcode6780
>>
>>107593034
>https://www.youtube.com/watch?v=rqyw9cjbkbg
This is magnificent
>>
>>107579796
as someone used to high-level programming (Java), this is expectedly getting slightly easier with each level
>>
>>107593102
Some of the last levels on the hardware tier are mostly just formalities.
>>
>>107593034
RGMechEx
DouglasDwyer
AngeTheGreat
SheafificationOfG
Naviary
Mutual_Information
Radian628
Earthcomputer
MattKC
>>
>>107593060
comfy
>>
Is vim actually beneficial for programming or is it just one of those things autists keep promoting just to be different just like they do with linux?
>>
>>107593661
Vim allows you a very streamlined workflow without ever taking your hands of the keyboard, if you learn it right. But before you learn all the things you want to do in finger muscle memory it's not intuitive and learning curve is steep.
And it's very customizable, or so I've hear, but again not very intuitively.
If you're working in a Linux environment you probably should get acquainted with Vim on at least a very basic level because it's the default terminal based text editor on many systems.
>>
>>107593661
>like Linux
Yes, it's as useful as Linux
So very
people don't talk about it to feel 1337, but because it's actually useful
if you don't understand Linux it's your IQ problem
>>
Why is almost all useful software written in supposed midwit languages like C, C++, Java, JS, Python, Go etc. while “I am very smart look at me” languages like Haskell, Clojure, Lisp, Rust, ML etc. usually have a single example of real world success, if that? Are functional languages a psyop to keep White men from building things?
>>
>>107594542
You get useful software as a side effect of building any software. There's tons and heaps of midwit software next to the useful software.
>>
File: file.png (25 KB, 622x187)
25 KB
25 KB PNG
>>107575071
post innocent looking code that does very bad stuff
pic related creates a several GB large memory leak
>>
>>107594834
>tell the language you want O(N^2) copying
>it does it
how dare it
>>
File: maxresdefault.jpg (90 KB, 1280x720)
90 KB
90 KB JPG
>>107593060
>>
>>107593060
>print("\n") instead of say()
>bareword field handles and 2 arguments open
>foreach instead of for
>parentheses around each fucking function call
>>
Respect your elders.
>>
>>107594542
Rust is literally everywhere nowadays.
>>
File: map_0.png (28 KB, 384x384)
28 KB
28 KB PNG
>What are you working on, /g/?
Map support
>>
>>107594542
All the fundamental software is written in C and C++ because it needs to be fast. Simple as that.
>>
>>107595980
Fundamental software is written in assembly.
>>
>>107587704
I had to look it up, basically a switch/match statement on the type of the first argument? If you could really dispatch on the type this would be a great feature but since it's just a preprocessor working on strings/tokens and not a entire front end that does parsing and type checking, you could really distinguish [u]int[8|16|32|64], float/double, strings and bools if the expression happens to be a literal, but otherwise you can't know what you have so I don't really see the point in a feature that much restricted...

What would be possible however, are macro directive that would do string comparisons and pattern matching on strings and expand to the corresponding block. That would be really useful imo.

Another feasible and practical thing would be variadic argument: $define $macro($arg1, ...$arg2) {...}. Each of the argument inside $arg2 would be macro expanded and when $arg2 would be used in the macro body, it would expand to the expanded argument, joined by commas. Useful for function calls, arrays literals and comma expressions. I suppose it would be pratical to be able to join with ";" as well, for structs and unions.
>>
File: gotk3-opengl.png (64 KB, 1920x1048)
64 KB
64 KB PNG
Today I managed to get GtkGLArea working with Go and gotk3 library (OpenGL 3.3 core).
Tomorrow I am going to try and make the scrolling with the scrollbars work.
I hope this doesn't take long. Maybe I should have just used OpenGL 2.0
>>
Assembly is HARD. I don't like technology anymore.
>>
>>107590478
>make your own gui toolkit
that's a lot of work
>>
>>107596455
but you don't need to write entire softwares in assembly, just specific parts
>>
File: 1753148763191310.png (1.03 MB, 948x716)
1.03 MB
1.03 MB PNG
>>
>>107597181
bubbly
>>
File: derp.jpg (48 KB, 800x450)
48 KB
48 KB JPG
I might be an idiot and I don't know why.
I just spent a good while making a bash script to compare two video files to see which one is better quality.
Pretty simple right? Just use ffmpeg to measure PSNR or SSIM or VMAF.
Well for some reason I decided fuck that I'll do it my own ass backwards way.
My way consists of extracting individual frames from each video at specified timestamps (let's say every 10% of the duration) and then comparing each one using imagemagick to compare with rmse and generate a report with the score for each compared frame and a final average score across all extracted frames. If the current frames have a large discrepancy in their scores it creates an A/B image for manual inspection. If the average scores is good the report says keep the new version, otherwise keep the old.

What the fuck was my problem?
Why didn't I just use the normal methods?
I knew about VMAF etc beforehand but I didn't use it.
There was a reason and I can't remember at all why.
Anyone here know their shit about ffmpeg and imagemagick who can shed some light on why I wouldn't have used ffmpeg and whether or not my method is a complete waste of time that doesn't produce useful data?
>>
>>107597733
And now I posted with grammar mistakes and typos out the ass.
I might genuinely be having a stroke.
>>
Finished my CS courses with a ChoHan game.
Now I just need physics and calculus for my degree.
>>
implemented nestable /* */ comments and found this bullshit SO answer

https://softwareengineering.stackexchange.com/questions/81072/why-do-most-programming-languages-not-nest-block-comments/361797#361797
>you're doing it wrong
>it's bad
>>
I want to have Rich Hickey’s babies. Clojure is the single greatest most pragmatic language ever made. 99% of the benefits of lisp with 1% of the autism and troons.
>>
whats the recommended git/github tutorial?
>>
File: pepe.jpg (30 KB, 474x461)
30 KB
30 KB JPG
>.net blazor has all the features that phoenix has, including liveview
What is even the purpose of these different webshit frameworks? Elixir processes are cheaper than actual threads, so liveview might be lighter on memory, but still.
>>
File: new sweet expr.png (15 KB, 483x161)
15 KB
15 KB PNG
Just started learning Clojure, it's comfy :)
(defn deus-vult? [] 
((if (> (rand) 0.5) < >) (rand) 0.5))
>>
File: 1376182921994.jpg (47 KB, 445x488)
47 KB
47 KB JPG
>Writing some python stuff
>Accidentally overwrite some variable by reusing a name
>Took ages to figure out
God damn, I didn't realise how much I hate it when languages don't have proper lexical scope and variable shadowing
>>
>>107599690
I spent so long in erlang development that I forgot this could be an issue.
>>
>>107599690
>God damn, I didn't realise how much I hate it when languages don't have proper lexical scope and variable shadowing
Today I remembered once again that in C you can't do:
struct type *x = something();
if (...) {
struct type2 *x = (struct type2 *) x;
}

Because in C, x on the RHS refers to the x on the LHS, no the x in the outter scope.
This fucking sucks, you can do this in languages with non-retarded name resolution rules.
>>
>>107599750
actually never mind the casting, there are use cases for simply copying a variable
>>
>>107599750
I have written code that'll actually refer to itself in its own declaration, which that'll break.
But also that's niche as fuck and I'll agree that Rust's shadowing (and whatever it copied that from) is generally nicer.

As long as we all agree that python's way is crap.
>>
>>107596886
>just specific parts
I'm struggling enough with just that. I just got to the assembly part in nandgame. I thought it would be fun, but it's the opposite of fun.
>>
>>107599202
>git tutorial
https://www.atlassian.com/git/tutorials/setting-up-a-repository
https://git-scm.com/cheat-sheet
>github tutorial
https://docs.github.com/en/get-started/start-your-journey/hello-world
>>
>>107600763
>I'm struggling enough with just that
with what? manual register allocation? decomposing expressions into assembly instructions? SIMD?
>>
>>107600958
I'm too retarded to answer this question.
>>
>>107600763
other than learning how the stack works & the strucure of program memory & maybe remembering calling conventions, isn't it just memorizing what very simple individual instructions do? cant be that hard especially if you already know the first things.

t. doesn't know assembly either.
>>
File: 1407905937240.jpg (23 KB, 500x375)
23 KB
23 KB JPG
>Trying to solve an optimisation problem that looks travelling salesman-ish
>Eh it'll be fine, I'll just try an exhaustive search, I'm sure 28 nodes isn't too many
Turns out 28 nodes is way too many.
Now to work out if my problem is actually travelling salesman, or maybe restricted enough that dynamic programming or some shit works.
>>
working on a Sketchup Plugin in Ruby that does my CAD job for me while I sit back and drink beer
I'm not very good at Ruby, so I'd like to ask - how easy is it to split something up into different files? I have no idea how modules, namespaces and such work
Right now my code looks kind of like this

module MyPlugins
module Autogen
@@parameter1
@@parameter2
# a bunch of other parameters relating to 3d object dimensions

# a bunch of functions that do sketchup stuff

# a bunch of functions that create "componentdefinitions" based on @@parameters
end
end


I would love to split out all the code that generates "componentdefinitions" into another file, but they need all the parameter data, which can change during execution.
Is it worth doing this, or will my code turn into a giant OOP spaghetti mess?
>>
>>107601125
I don’t know ruby but that’s the kind of question LLMs excel at
>>
>>107601154
fair enough, I'll probably just keep it in a single file and use IDE tools to find stuff since it's not gonna break 1k LOC
trying to keep this project LLM free in general, since i'm using both an unfamiliar language and API at the same time and need to be able to understand what every line does
>>
>>107601154
>but that’s the kind of question LLMs excel at
Is this current year phrasing of
>just google it
?
>>
>>107601201
Then just google it

>>107601366
I guess so
>>
File: respond.jpg (227 KB, 960x960)
227 KB
227 KB JPG
>>107581681
>GUI
>>
File: REFLECTION.png (1 MB, 960x1073)
1 MB
1 MB PNG
>2025.99
>Company uses typescript backend
>Finding that our class validators are buggy and error prone since there's nothing tying your typescript class to the class-validator attributes
>Someone suggests we change our models to Zod, a library for more strict type guarantees at both runtime and compile time
>
//instead of
class Player {
@IsString()
username: string;
@IsNumber()
xp: number;
}

//do

const Player = zod.object({
username: zod.string(),
xp: zod.number()
});

type PlayerType = z.infer<typeof Player>;

>picrel
>>
>>107602475
How would you do this in Java then?
>>
>>107602498
Java and C# have reflection. ORM and web frameworks can validate the input of some JSON payload from the class definition itself. In java:

public class Player {
private String username;
private float xp;

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public float getXp() {
return xp;
}

public void setXp(float xp) {
this.xp = xp;
}
}


(bean pattern, which is verbose but you get the strong guarantees with it)

Or in the vastly superior C#:

public class Player {
public string Username { get; set; }
public float Xp { get; set; }
}
>>
>>107602551
>ORM can validate json payload
what

And where is the validation in your code? Zod is a schema and validation library. You just wrote bunch of getters and setters.
>>
>>107602583
Validation is handled by the framework. Can write your own if you want
>>
>>107602606
You can write your own in typescript as well. I do not understand your comparison. Nothing you have shown in your Java code would require Zod when rewritten in Typescript.
>>
File: inoculation.png (1.92 MB, 960x1692)
1.92 MB
1.92 MB PNG
>>107602646
Typescript does not have runtime type information (RTTI). You cannot declare a class in typescript like this:

class Foo {
bar: string;
}


and interrogate that type later. i.e, you cannot get a list of fields and their types without a 3rd party tool like zod or class validators. This means you either have to
>a) Write your type information twice (class-validators) risking human error
>b) Write your types using runtime code and infer the types from there, not using any of the native tools for declaring types (classes, types, interfaces) which is a very code-smelly solution and also looks like shit
>>
>>107602716
Type information is not sufficient to validate anything non-trivial. You still need to provide information about eg min/max value, length, optional/nullable, variants, allowed patterns, etc. There is nothing Java or C# offers that can figure it out automatically.

There is also 3rd option. You describe your schema in a schema file and then generate both runtime validation code and static typings, possibly in any language you need.

I personally just wrote my own simple TS library that just uses decorators to describe the validation for each field and can also deeply translate between client side and server side types, so for example standard browser's File on client becomes multer's File on backend.
>>
>>107602808
Yes retard, no shit you need decorators to validate URL structure and max values of numbers, but 90% of validation IS trivial, and the lack of RTTI makes Typescript an inherently poor choice for backend development
>>
>>107602824
>Yes retard, no shit you need decorators to validate URL structure and max values of numbers
Then post Java code that does this, so we can compare it with equivalent Typescript code.

>90% of validation IS trivial
Nearly all fields in my APIs have constrains that cannot be deduced simply from type information.
>>
>>107602475
Haskell
>>
File: girugamesh.png (122 KB, 452x391)
122 KB
122 KB PNG
>>107602842
>Then post Java code that does this, so we can compare it with equivalent Typescript code.
NO YOU FUCKING MONGOLOID YOU'RE MISSING THE POINT OF THE POST AHHHHH YOU FUCKING ZOOMER RETARDS MAKE ME FUCKING CRAZY ASDJFHA;SD JFHA;SDLKFHJA;SLDKFHJAS;LDF

THAT'S IT! YOU'VE WOKEN THE DRAGON!!!!
>>
Dumb midwit
>>
I hate doing any complex stuff in C I need one trillion structs that I need to free manually this is awful
>>
>>107602970
Use C++, use smart pointers, never free anything again
>>
>>107602970
Use a language that was made this century.
>>
>>107603431
Rust is the only one I can think of and I’m not even sure someone who likes C would appreciate it. What anon wants is literally a first class feature of cpp called RAII
>>
>>107602970
Why did you choose C?
>>
>>107602970
zelang-dev/c-raii
>>
>>107575071
LLVM is fuckign annoying to work with.
>>
>>107580913
Write yet another llvm wrapper language that'll "solve" programming
>>
>>107602842
>Then post Java code that does this, so we can compare it with equivalent Typescript code.
nta but depending on the use case the code will vary extremely

guessing what the other anon means is that if you declare a Player class, it will be inherent that instances of it will always have fields username and xp; using reflection, a framework can read what fields the Player class has (username and xp) and do validation based on that (not values but just the structure of the object - if the structure is wrong, there's little point in validating values' ranges/patterns/etc)
>>
>>107602970
Stop using pointers, start using globals.
>>
>>107603672
>nta but depending on the use case the code will vary extremely
Yes, and my point is that it very often doesn't look much different from his first decorator example.

>a framework can read what fields the Player class has (username and xp) and do validation based on that (not values but just the structure of the object - if the structure is wrong, there's little point in validating values' ranges/patterns/etc)
When you are validating payloads in context of writing a backend, you typically put constrains on values of all the fields.
There is no point in moving that value validation somewhere else, this will only result in spaghetti code. Also it is a good practice to have all instances of your types maintain their invariants at all times. There should never be an instance of a type that is structurally-checked but not yet value-checked.
>>
>>107603569
bet it was because probably c is fastest
>>
>>107603842
People who say this just don’t understand anything. If you are chasing pointers in C and use a memory arena in Java, then even Java will be faster. And given the same code the different between C and cpp/rust is negligible. You use C if you have to meet very specific hardware or platform requirements or if you’re processing such massive amounts of data that a 10 cycles difference with cpp may turn into 10 minutes of execution time
>>
>>107603899
And I’m not even sure about the latter. DirectX is cpp unlike vulkan and opengl and it’s just as fast.
>>
>>107603899
>C
>performance
all HPC code is C++ though?
>>
>>107603842
I kind of regret asking. I wasn't trying to sound facetious.
>>
>>107599202
the jeet one and don't forget to send an update readme pr to expressjs
>>
>>107603979
>all HPC code is C++ though?
wrong, numerical code is written in Fortran
>>
Anyone else have successful daily programming sessions that eventually lead to a literal state of euphoria for a few days?
>>
>>107603782
>There should never be an instance of a type that is structurally-checked but not yet value-checked.
That's only true when you don't have general graphs. Once you do, you need to have transient technically-invalid instances while you're inflating some of the other parts of the graph (because there isn't a natural monotonic ordering).
By the time it gets out of the deserializer, there should be no invalid instances. But you can't maintain that invariant during deserialization for anything more complex than a DAG.
>>
>>107602824
>90% of validation IS trivial
Syntactic validation (eg, is this numeric) virtually always, yes. Basic semantic validation (eg, integer in fixed range), usually too. Compound semantic validation (eg, start of range not greater than end of range), rarely but can happen with good tooling.
Validation that requires looking in a DB (eg, must be an existing primary key) or at another service, not trivial at all by definition.
>>
>>107602970
You can probably write your code more efficiently. Remember, structs are about grouping some data in memory where you want to refer to the pieces by name.
>>
>Ctrl+f
>0 found

You guys, uh, like Nim?
>>
File: 1731959206819562.jpg (43 KB, 771x788)
43 KB
43 KB JPG
Working on a Go pet project & started learning Rust again :3
>>
>>107603936
DirectX is C with a C++ wrapper around COM objects.
>>
>>107575071
waiting until i feel like working on my kernel's gpu driver again. tech is all so boring
>>
>>107606247
>tech is all so boring
You know, I've started to feel the same.
>>
>>107606226
what is there to like?
if the language statement is "a better Python", no thanks
>>
do you guys lift weights?
also what pet projects do you have and how do you find them
>>
>>107606074
You can construct a graph, vertex by vertex, edge by edge, in a manner that does not put it in an invalid state at any moment.
If you want some graph that has an additional constrain that would make it tricky, for example CompleteGraph that you couldn't validate until you fully construct it, you can just use general graph type struct while you construct it bit by bit, and once that done you can check if it fulfills criteria for a complete graph before you return CompleteGraph or throw an error otherwise.
>>
>>107606263
i once saw someone mention that long-time programmers are really just socially inept man-children that wouldn't fit well in any other work, and i'm beginning to wonder whether that's true. a lifetime of this shit seems utterly unfulfilling
>>
Hot take: Programming in Machine Code is based, and is the only way anyone should ever program, ever.
>>
>>107606416
>t. computer science freshman
>>
>>107606226
The ref/weakref business doesn't inspire confidence in me.
It's cool that it compiles to C.
>>
>>107606416
no. you should manually poke the transistors
>>
As a general rule of thumb how many hours a day do I need to dedicate to programming to pass my classes in college with ease for CompSci? I had to repeat the year because my project was apparently too basic (fucking foid bitch). I am trying to change that now since I'm really pissed off.
>>
>>107606416
No. Nonononono. Just no!
>>
>>107606323
>socially inept man-children that wouldn't fit well in any other work
Definitely feels relatable in my case.
>>
>>107606703
Full working days and a lot of late nights.
>>
>>107606577
>It's cool that it compiles to C.
That's the sign that the language and the language author are retarded. This will lead to unnecessary complexity in the implementation and into the language design. They can write a native compile from scratch now but it won't matter, it's too late.
>>
>>107606416
Ok, let's see your fizzbuzz.
>>
>>107606990
A C backend means you can bootstrap your previous compiler and can self host without an ever increasing toolchain, the complexity must live somewhere.
>>
>>107607097
>A C backend means you can bootstrap your previous compiler
A C backend is unnecessary for this purpose, you can perfectly bootstrap from a bytecode VM.
>>
>>107607161
But how do you compile the VM?
>>
>>107606762

Just think about it for a moment:

- No bloat
- No JavaScript
- No big tech retard copycat will understand what your code does
- Big tech will think your code sucks, is racist, and unethical, which is a plus on its own
- People will underestimate your code
- People will think your fucking stupid for considering machine code

Oh, and don't mind if I tell you... JavaScript is gay.
>>
Erlang is king!
>>
>>107607207
I'm saying to make a bytecode VM in C and a bytecode compiler for that VM in C.

Like I said, you don't need to generate natively compiled programs with the help of a C transpiler in order to write a native compiler.
>>
>>107607338
By making that argument, you assume that the author/defendant knows what a bytecode VM/compiler is.

The GNU/Linux Operating system supports x86/arm assembly, which both are fed into a bytecode interpreter, which is called a CPU.

Unfortunately for the average Python programmer, the CPU is bad at parsing code that involves text. Therefore, a JIT compiler is required, which forces hot & spicy code down a compilation engine, which takes 52 business days to complete, because the overhead to parse strange text is too much for a retarded CPU to handle.

Therefore, a VM is introduced, which may or may not reduce this complexity, while also making hot & spicy code fresh and ready to eat for every CPU under a hot and sunny day.
>>
#ifdef DEBUG
#define $D(normal, debug) (debug)
#else
#define $D(normal, debug) (normal)
#endif
>>
>>107607418
What you are you talking about retard? This is not making any more fucking sense that this retarded post >>107607207.
>>
>>107607746
Ahh, yes.

The CPU is extremely retarded. Therefore, it requires a virtual ISA targeting a VM (which is also retarded).

The retarded VM does a retardmaxxing switcheroo between VM bytecode, and CPU bytecode.

This is so that the retarded CPU can interpret the retarded VM's bytecode, which was compiled by some retarded C compiler, which was compiled from some other retarded compiler from some other retarded language, which was compiled from some other bytecode, which was once retarded Python code, which some retarded programmer (like myself) thought was actually a non-retarded piece of genius code that would win the Nobel prize, and land me a retarded big tech job where I could build space ships and not be fucking retarded for once.

Refined retard-maxing to its finest.
>>
>>107607803
Dunno who he is, I saw your point on using the C compiler to have a VM and have the bytecode be language and arch agnostic so by generating compiler 0 bytecode with OCaml you are done forever and can self host as you don't lose the bytecode or the VM.
So the Java, Python, SBCL approach.
Maybe it's for the best, maybe not, I wouldn't know if the complexity of targeting C would exceed the complexity of targeting the VM and maintaining its C. So I can't really comment.
>>
>>107607214
>- No big tech retard copycat will understand what your code does
That's because my code WON'T DO anything, for how long it takes to write and how many mistakes it will contain.
>>
>>107607966
I've heard them big tech vibe coders are professionals at making code that does nothing with a million mistakes.

Which one is better, may I ask? May I also ask whether or not you have actually programmed in machine code?

(btw i may or may not be a troll, but it is funny when you cant be sure whether this is a troll post or not... why am i saying this)

I would like a logical and consistent argument. Good luck,

:p
>>
>>107607855
Since you're also designing the VM, you can make it as simple as it needs to be. At the end of the day a bytecode VM for a statically typed GC-less language doesn't need to be more than a single function with a while loop and a switch statement. Pus maybe a couple of helper functions to reallocate the function call stack.
Generating bytecode is no more complex than generating IR. Except if it's register based you need a little register allocator but that is well worth all the benefits.

The front end (parsing, name resolition, type checking, maybe macros and reflection stuff) is identical whatever you're targeting
>>
>>107607708
what's that, anon?
>>
>>107608297
Some haram anon using $ in identifiers.
>>
>/aocg/ fucking dead
guess I'll just go visit family then, thanks for nothing Eric

have fun reading this drama out loud: https://forum.nim-lang.org/t/13575
>I suspect your desired contributions are limited to those which conform to your peculiar needs/wants
I coughed while trying to provide the appropriate emphasis for PECUUUUULLIAR NEEDS SLASH WANTS
>>
>>107608094
>At the end of the day a bytecode VM for a statically typed GC-less language doesn't need to be more than a single function with a while loop and a switch statement.
It's a little more complex than that, depending on what exact bytecode ops you're supporting. If you're making your own, you can have the ops that you want in there to make the rest of your system simple.
For example, the bytecode ops for SQLite's internal VM are quite different to the ones in the JVM.
>>
>>107609444
We're talking a VM for running a general purpose language here so yes it's as simple as that. Local variable load/store, memory load/store, arithmtic, bitwise, comparison, control flow, function call instructions and that's basically it.
>>
Let's say there's some parameter that can be an integer between 1 and 100. In the program's config.ini file, the user sets it to some number greater than 100. When we load the .ini file, we see that it's more than 100, so we just treat it as 100. Should we also change the value in the .ini file to 100, or should we just leave it?
>>
>>107609713
If it's a configuration file, leave it.
If it's just your program serialising some state that a user messed with, overwrite it.
>>
>>107609713
And if the dumbass user during runtime notices and changes 100 to 200 again then what. You gonna read the whole file and do IO every single time you want a single option in order to update the config?
>>
i feel like im going insane. im using `go.bug.st/serial` to access a usb oled display via `/dev/ttyACM0` and im able to open the fd if i run the binary as sudo, but just running the binary as my user on a raspi zero 2 w gives me the error `Serial port busy`. my user is in the dialout group and the permissions onn /dev/ttyACM0 are `-rw-rw-rw`. i genuinely dont understand why im able to open it with sudo and not as my user.

i installed go on the pi zero and threw the following code on there and built it and it works without issue, so i genuinely have no fucking clue whats going on.
package main

import (
"fmt"

"go.bug.st/serial"
)

func main() {
const FD = "/dev/ttyACM0"

mode := &serial.Mode{
BaudRate: 115200,
}
port, err := serial.Open(FD, mode)
if err != nil {
panic(err)
}
fmt.Printf("Successfully connected to %v:\n\t%v\n", FD, port)
}


im guessing that there are some platform specific checks in the serial module or its dependencies that break when it builds onn x86_64 then runs on arm, but i dont understand why running the binary as sudo would fix that?
>>
File: output.png (48 KB, 825x396)
48 KB
48 KB PNG
>Looking at python docs because I'm doing some stuff with sets
>set > other
>The subset on the the "big" side of '>'
What kind of retardation am I required to have to think that's the way around it's supposed to go?
>>
>>107609954
wdym? This is perfectly normal.
>>
>>107610094
Fuck, I just realised that bottom one says superset, not subset.
>>
>>107585573
>>107585755
super cool

i don't think it would be useful to me but I am curious about thow you made the frontend

did you use any frameworks?
>>
>>107609517
>VM for general purpose language
butwhy.jpg
Issue machine code, use JVM or .NET (both of which are better than anything you'll make), or encode your language assumptions so that your VM actually helps you.
>but my language has no assumptions!
lmao if you actually believe that
>>
>>107609727
>If it's a configuration file, leave it.
Or issue an error so that the user knows early that they're being a dumbass.
>>
>>107597733
kek i do bullshit like this all of the time
>>
>>107590220
Imagine being this much of a brainlet. Of course he did. RedSea filesystem, bitch
>>
>>107610304
>butwhy.jpg
read the reply chain anon, we're talking about bootstrapping
>Issue machine code, use JVM or .NET
it's a LOT simpler to generate raw bytecode for a switch statement and JVM is very limited in terms of primitives: signed integers and limited control flow
>assumptions
such as?
>>
>>107609821
works for me
>>
>>107610479
works on pi 3B+ too
>>
>>107610479
>>107610526
yeah, im able to get that code to work without sudo when i build it on the pi zero, and also when i build _only_ that code on x86_64 and scp it over to the pi zero. i must be doing something wrong in my actual code and i have no idea what.

i fucked around with it and now its working without sudo? bizarre and i dont really care to figure out why.
>>
>>107608030
>May I also ask whether or not you have actually programmed in machine code?
Barely at all. Like literally one line of machine instruction is my sum and total experience. If I was forced to keep doing that, abstracting it into a higher level language is the first thing I would be trying to do. And if I was forced to do THAT self-hosted from scratch I would definitely fail and go live under a stump in the woods instead.
>>
>>107610632
>i fucked around with it and now its working without sudo? bizarre and i dont really care to figure out why.
since it said "port busy" i am assuming it's something something odd USB crap. I think I had it before, but not sure.
Since yours is ACM0 and not USB0, there is also some differene. Iirc ACM0 is pseudo serial, while USB0 is a "real" usb device and they probably do something different in the kernel. I just had no ACM0 device on my table or in reach atm.

The new fucking captcha is fucking horrible. I should've not come back. Holy fuck. Fuck you hiroshima
>>
>>107609713
Your program should immediately exit with an error without trying to do anything else.
>>
>>107609713
any time ive written something that takes a config, i write a default config file in the source that is read on program entry, then overwrite that in memory with whatever fields are present in the user config, if present. value errors should be dealt with here and exit the program, making it explicitely known that the value is invalid and why. its a very similar pattern to how things like configs for ssh work where there is some master config that mutates in memory after reading in additional configs and crashes when an invalid config option is encountered.
>>
File: BIGCOCK.jpg (2.33 MB, 4032x2268)
2.33 MB
2.33 MB JPG
Tweet 1/2.
Ok as I already shitposted here a lot, I have this scoreboard.
It worked all fine and dandy, but the time still had to be set via a web interface (there is already a remote to start and stop and set score plus minus).
So I realized that web interfaces are stupid and for a fun game with frens (3D) I want to make it usable without fones. So I need to build a cute remote to set the time.
>>
File: smallcock.webm (3.58 MB, 640x853)
3.58 MB
3.58 MB WEBM
>>107611484
Tweet 2/2
lol i forgot to prep the video.
But anyways, now I am building a smol remote with an esp32. Looks cute for now. I think this does the trick.
This is just a mockup. Now gotta connect it to the actual scoreboard which has a esp-now receiver and some protocol that should be easy to extend
>>
File: aoc2025rs-08.png (136 KB, 528x1424)
136 KB
136 KB PNG
Advent of Code thread died so I guess I'll post here now.

Actually a somewhat interesting puzzle if you do the tree thing I vaguely remembered from the thread 2 weeks ago.
I'm sure there's a smarter way to count the set sizes rather than walking to the root 1000 times.
>>
File: o1.png (54 KB, 1440x1080)
54 KB
54 KB PNG
i made a script to procedural-ly make these images :)
>>
File: output.jpg (74 KB, 110x2000)
74 KB
74 KB JPG
>>107611936
>>
>>107610802
If you program in machine code, it gets easier over time. I don't think machine code is this impossible language that you should never even attempt to try.

Admittedly, no one programs in machine code anymore, because the Microsoft bros managed to convince everyone that high-level is the only way.

Machine code is only as slow to develop for as the tools surrounding it.

If C# had no immediate, well documented way to interface with GUIs, nobody would use it. I think its the same way with machine code.
>>
File: captcha_formatter.png (28 KB, 358x287)
28 KB
28 KB PNG
>>107575071
Cliche but userscript that shows all the captcha images on one screen
The browser debugging tool was very helpful when figuring out where to inject my init code
>>
>>107611936
<3
>>
File: 1766189279411352.jpg (675 KB, 1920x1200)
675 KB
675 KB JPG
>>107606416
>>107610802
>>107612532
My only experiences writing machine code were rom hacking games with a hex editor and writing programs for a cpu simulator in uni, still used higher level mnemonics before hand-assembling tho
>>
File: coolkidfromtheblock.webm (715 KB, 640x1138)
715 KB
715 KB WEBM
>>107611533
tweet 3/2

We workin (at least one way)
The USB cable is just for power. Communication is wireless over esp-now.
Haven't tried on real hardware yet, but since I am a genius, I have SEPARATION OF CONCERNS and it will just work anyways
>>
>>107611936
That's nice.
>>
>>107610455
I've been writing a simple VM for a general purpose language just as you said, and I pretty much came to the same conclusion. Adding opcodes or higher level assumptions seems like it's a noob trap. You should just generate the appropriate simple instruction chains to create higher level behavior, since it makes things more uniform and general in the VM. It seems preferable to have some pointer related opcodes and then build string handling on top of that. Having segmented memory is also annoying because it bloats the instruction count and codepaths, so I should have used as flat a memory model as possible. I stored locals and constants in a fixed array inside a callframe struct which I have a stack of, but I should have done a real callframe on the regular stack.
>>
>>107612532
>Machine code is only as slow to develop for as the tools surrounding it.

Are there any efforts to develop better tools for it?
>>
>>107612532
>If you program in machine code, it gets easier over time.
Of course it does, assuming you spend that time programming in machine code. But why would you when you could spend that time programming in a higher level language that also gets easier with experience.
>Machine code is only as slow to develop for as the tools surrounding it.
Principal among those tools is a higher level language and a compiler.
>>
>>107612532
Do you mean programming in machine code or programming in assembly? There is no reason to write hex, but assembly has a use case.
>>
>>107612878
Assembly does in fact have no usecase.
>>
>>107575071
I’m tempted to make a site for sifting through the Epstein files with a vector database and stuff, but I know there are probably a few dozen people doing it already so it’s just a waste of time.
>>
>>107612878
He means hex/oct/bin, and obviously there's a usecase when there's no assembler
>>
>>107612835
A human can also make for a working compiler. You don't need a separate compiler to have a working (and fast) toolset.
>>
>>107612835
I can also argue that nobody needs to move to a higher level language, because machine code already does everything you would need out of a language.
>>
>>107612957
If you don't have an assembler, write one. It'd be easier than writing a program in hex with more than 10 instructions.
>>107612884
>he says, while sending his post through many layers of handwritten assembly
>>
>>107612971
You could argue that, but it would be a retarded argument.
>>
>>107612996
I could also argue that your argument is more retarded than mine, in which case, we both become perpetual retards.
>>
File: thumb.jpg (51 KB, 1280x720)
51 KB
51 KB JPG
https://youtu.be/1iPWt1gvT_w
Rust and the price of ignoring theory
>>
>>107613027
xd
>>
>>107613027
>such bad microphone
>52 minutes
lol no
>>
>>107613103
you will never be a woman
>>
>>107613111
true. But inserting my big cock into milf pussy feels good. Thanks for asking
>>
>>107612794
What I see is that people make a simple VM like the WebAssembly guys and it's portable and great and you can bootstrap your thing with it but eventually the language wants GC support or tail call support or whatever to simplify code generation or to not have to pop/push so much data you're slower than Python. At which point you generate native code to get exactly what you want. So the noob traps just delay the inevitable.
>>
I made a stack based very constrained bytecode spec for a project.
No branches, no jumps, no loops, just opcodes corresponding to boolean functions
I even went so far as to enforce that you have to consume the stack you create in it.
It's working very well, having it be so featureless is actually turning out to be a good thing.
>>
File: TNG Data IWNAB.gif (1.9 MB, 480x357)
1.9 MB
1.9 MB GIF
>>107613111
>>
File: 1766183146971164.png (251 KB, 1920x1080)
251 KB
251 KB PNG
>>107575071
"improving" my 4chan viewer for emacs



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.