Accidentally created ASM++ | Prime Reacts

  Рет қаралды 60,745

ThePrimeTime

ThePrimeTime

Күн бұрын

Пікірлер: 171
@monad_tcp
@monad_tcp Жыл бұрын
2:29 C is like a circular saw hanging from the ceiling by a chain and you use it like nunchakus , C++ is like a portable angle grinder that you also use like nunchakus
@basedfacistman
@basedfacistman Жыл бұрын
and rust is like the tranny dildo
@fredflintstone8048
@fredflintstone8048 Жыл бұрын
I love meaningless analogies for different kinds of computer languages. They're often simply parroted by people who wouldn't know how well they hit the target or not.
@complexity5545
@complexity5545 Жыл бұрын
I like this analogy better. Its a little more accurate. LoL I mean which one is more dangerous: the "angle grinder." Some people don't know how much PPE you have to use with an angle grinder which depends on the blade and the stock.
@complexity5545
@complexity5545 Жыл бұрын
@@fredflintstone8048Some of us programmers have to man handle crazy tools for the engineering stuff. The saws are accurate. More people get injured by those darn angle grinders than the circular saws due to abuse; just like c++. They never see it coming. Some fools take the safety guards off angle grinders and go head first into incorrectly using it. Next thing you know, you're in a emergency room because the blade road up your chest and into your neck. Its just like the horror stories of c++. loL
@jbvalle
@jbvalle Жыл бұрын
As an embedded systems engineer I mainly work with C. We mainly use assembly for tasks where we want to achieve run time optimizations of like 3-4% or a bit more. We also use assembly for tasks where our uC has some new not yet fully supported peripherals used for encryption or any kind of processing enhancements where assembly could give us improved performance. For these purposes assembly is really great, I think people just misunderstand the purpose of C and Assembly, because systems especially near to the hardware where you need this kind of control these languages both work great
@stends113
@stends113 Жыл бұрын
So he reinvented *Macro* Assemblers? Of course i see some improvements, and new items, but the concept has been there since at least the 90'ies.
@Gregorius421
@Gregorius421 Жыл бұрын
Only TASM, MASM, HLA support function call and conditional syntax, as an extra to the macro assembler part.
@official_mosfet
@official_mosfet 11 ай бұрын
This project can be no joke the future and i wouldn't care because it would be really cool
@c4ashley
@c4ashley Жыл бұрын
As a sometimes-Assembly programmer myself, this is beautiful. Being able to see control flow, instead of a flat wall of instructions? Yes please! But I'm usually assembling for PIC or the ancient H8/500 though, so it'd probably be a bit big task to make it work for my use case.
@U_Geek
@U_Geek Жыл бұрын
I just finished a semester of "Computer architecture" the lab part was DOS masm asm programming. It was fun but after my 5th jump island I wanted to quit the course.
@OneMilian
@OneMilian Жыл бұрын
I don't know if I'm actually using Assembly, but I love compiling mid language code to assembly and observe how a cpu can solve problems. It's very clever and I learn alot by myself
@nashiora
@nashiora Жыл бұрын
While bootstrapping should definitely be possible for most general purpose languages to be considered feature complete, and as much as I like bootstrapping compilers, it creates a ton of extra work that is not often a great idea as your first step.Build your compiler, then some tools and additional test programs that are easier to verify both by hand and with your tooling, give it a real tester on your dev experience or software you don't care as much about. Once that's done you still have to make sure your original bootstrap compiler exists and is maintained through the whole duration of building the new compiler in its own language, and you'll need to keep that bootstrap around for a while after too. It's just a lot of work to be your very first goal (even though I wish it were easier, I would LOVE for it to be my first goal)
@ZehMatt
@ZehMatt Жыл бұрын
I wonder if people heard about MASM, it has structs, macros, variables, pretty much all you need.
@overbored1337
@overbored1337 Жыл бұрын
Yeah masm is great. Also thanks for Zydis 🙂
@UnFiltered1776
@UnFiltered1776 Жыл бұрын
That floating sawblade is optimal if you can build the Rube-Goldberg machinations to queue up and launch your data at it.
@AllanSavolainen
@AllanSavolainen Жыл бұрын
Borland Turbo Pascal was nice as you could just begin assembler block and write nicely intended asm and then end the block and continue in Pascal.
@longlostwraith5106
@longlostwraith5106 Жыл бұрын
So... a macro-assembler. A tool that existed since the 70s...
@FQAN17
@FQAN17 Жыл бұрын
I worked in ASM back in the 80s. Guess I’m one of those old people.
@styleisaweapon
@styleisaweapon Жыл бұрын
do you recognize that this guy is reinventing turbo assemblers ideal mode, but isnt using macros for reasons?
@efemboygg
@efemboygg Жыл бұрын
i have no idea why i learned nasm, but i did it a while ago and was kinda surprised that i recognized all different nasm opperations liek jumps, moves, cmps, and other stuff that i forget. super cool to see an even easier to code asm language type thingy
@RadicalGaming1000
@RadicalGaming1000 Жыл бұрын
"A language is not a language until it can compile itself" - Prime
@Iuigi_t
@Iuigi_t 11 ай бұрын
So JS, Java, and Python aren't a language, because they aren't compiled
@marcogergele6183
@marcogergele6183 3 ай бұрын
I can't help but immediately think of the channel “Tsoding Daily”, the two are certainly brothers in spirit.
@fredflintstone8048
@fredflintstone8048 Жыл бұрын
I write ASM just for fun, as a hobby, and on my old IBM-PCXT. I'm too lazy to dig up and load an old C IDE / compiler that will run on DOS. The last project I did was write an interface for the battery backed clock calendar card that I got with the machine. I had no inteface software for it. I looked up the chip, traced the circuit, and wrote in ASM to support it. It works great. I see writing in ASM as a hobby. It takes too long to create anything non trivial in a production environment. Yeah, I'm an old guy who learned ASM in school although I used to irritate the professor by telling him that writing in ASM was a waste of time and that developers needed to write in C or C++... I told him I thought it would be ok to create TSRs with it.. He agreed, he tried to write one and couldn't get it to work.. 😂😂
@hi117117
@hi117117 Жыл бұрын
"The moment you program with strings is the moment you know you messed up" then what is any web server that serves HTML with inline JavaScript?
@Hector-bj3ls
@Hector-bj3ls 7 ай бұрын
C isn't like swinging wood at a floating saw. It's literally like wood work. You carefully measure, you spend years practicing, and as you gain experience you cut yourself less and less with the razor sharp tools. C++ is wood work with power tools. Some of the have plastic guards, but when you make a mistake you take your arms off with it.
@patryk3772
@patryk3772 Жыл бұрын
It is already asm++. It's called HLA (High Level Assembly).
@ProfessorRainman
@ProfessorRainman Жыл бұрын
Just subbed to the dude and he went from 11 subs (Prime being his 11th) and now he has 1.44k!
@ristopaasivirta9770
@ristopaasivirta9770 Жыл бұрын
I have been thinking of making a simplified version of C. C--
@foty7
@foty7 Жыл бұрын
You've actually been beaten to the punch there!
@knogger7756
@knogger7756 Жыл бұрын
Sadly, C-- already exists en.wikipedia.org/wiki/C--
@JakobKenda
@JakobKenda Жыл бұрын
my programming professor said: "C is a mustang. Java is your mom."
@skadragon
@skadragon 11 ай бұрын
You don't want any of your friends to see you riding her?
@nordgaren2358
@nordgaren2358 Жыл бұрын
Well, generally I only write asm for two reasons: I need to hook a function with a custom calling convention, and the easiest way to do that is to just write a wrapper that saves the arguments, call my hook, return and check return, then restore everything and jump back to the original function. So this solution won't work for me, unfortunately. The other reason would be to write asm in another process to call a function in that process, or to setup a code hook in another process. This be helpful, actually, but usually I do this kind of binary chicanery through C#. Usually I have a string that has some formatters in it, so I can place the args and function address in, as the args will change with each call, and the function address will likely change each time the program is restarted (if it has aslr), so I need an easy way to format said args and addresses into a string to be assembled by (usually) keystone engine, and then injected and called. I also generally do this with some kind of UI, since working with a process externally, and C# also allows for easy to create UIs, imo. At least that is what I am used to. I do want to replace the above with Rust, somehow. Even if I have to make it ffi with a WPF UI. Idk. I, personally, like writing assembly and the documentation that is required to use it. I don't have to do it very often, though.
@thommccarthy1139
@thommccarthy1139 Жыл бұрын
Is that Bird in the background? So good.
@kuhluhOG
@kuhluhOG Жыл бұрын
6:36 GCC and clang (LLVM's C compiler) are written in C++.
@randomcake1435
@randomcake1435 7 күн бұрын
The reason it uses string literals for inline assembly is because the compiler needs to ignore the fact that it's not valid C/C++/whatever syntax. It's not actually instantiated as a string literal in the program.
@casperes0912
@casperes0912 Жыл бұрын
When it comes to significant whitespace; It fits in with assembly. I'm generally against significant whitespace, but it fits with asm
@BryonLape
@BryonLape 11 ай бұрын
Assembler is too high level. Write the program on paper, convert the instructions and operators to hex, then enter them by hand into memory.
@-ciii-
@-ciii- Жыл бұрын
3:20 Well, unfortunately, due to System V ABI function call convention, we have to use registers to pass arguments to functions
@alexaustin6961
@alexaustin6961 8 ай бұрын
DUDE that stuff about the parentheses around the if statements is so true. I get upset returning to C++ from Rust simply because of that
@hirisu
@hirisu 11 ай бұрын
"My greatest programming pet peeve is when fors and ifs look like functions" liked subscribed fuck that nonsense
@josegabrielgruber
@josegabrielgruber Жыл бұрын
Holly molly, you've summoned Deitel Deitel. I agree with Prime, it's a very cool project, I'm really looking forward towards hearing more about it. But, please Code Nybble, be more civilized
@danielgrenehed2904
@danielgrenehed2904 Жыл бұрын
wow, how have I missed the fact that I treat functions and for/if differently with the space before the parethesis? And I do agree with prime, but I had not even recognized that I write code that way
@AllanSavolainen
@AllanSavolainen Жыл бұрын
Before watching this video I'll mention my old favorite, Sphinx C--. It was basicly assembly with some handy C features like loops and structs etc but most of the code was written as assembly.
@dooZyz
@dooZyz Жыл бұрын
To be fair, this is just a DSL that has ASM like features.
@winnie8614
@winnie8614 Жыл бұрын
I saw code that had space between function name and parenthesis
@retropaganda8442
@retropaganda8442 Жыл бұрын
Doesn't GCC already have a nice embedded assembly where you don't have to choose which register to use?
@bloody_albatross
@bloody_albatross Жыл бұрын
I don't know if that was a fever dream or real, but I think to remember there was some sort of win32 assembler that directly worked on the exe files, 20 years ago or so Like the project file WAS the release exe file. It had some syntax for defining and calling functions, but otherwise was assembly. If it wasn't a dream, that is. I think there was some emulator written in it. For NES or an even older system.
@tutoraqw
@tutoraqw Жыл бұрын
The guy in the video was listening brazillian bossa nova "The Girl From Ipanema". (BR here)
@actually_it_is_rocket_science
@actually_it_is_rocket_science Жыл бұрын
As an embedded aircraft software engineer __asm__ hits home. Static and dynamic code analysis tools hate it so much.
@thingsiplay
@thingsiplay Жыл бұрын
1:23 You argument would be true for any other language, but Assembler is actually just bunch of strings. What would be the difference, to have Assembler language embedded into C and not wrapped up in strings? The outcome what the Assembler compiler gets is exactly the same.
@3_14pie
@3_14pie Жыл бұрын
Every language is just ml syntactic sugar
@winnie8614
@winnie8614 Жыл бұрын
It needs register deallocation/relocation after making a call it would mess up current function's arguments
@Vlfkfnejisjejrjtjrie
@Vlfkfnejisjejrjtjrie Жыл бұрын
Baby hand on that thumbnail. Baby hand Prime
@musicalducky6623
@musicalducky6623 Жыл бұрын
Immediate like for not having parenthesis around if statements
@JLarky
@JLarky Жыл бұрын
5:59 confused CPython noises
@endredomokos1770
@endredomokos1770 Жыл бұрын
So you exploded this channel!
@remrevo3944
@remrevo3944 Жыл бұрын
The thing is around 90% of that can be done by switching from nasm to fasm (which is implemented in itself) and implementing a few things in its awesome macro system. Still cool project.
@infastin3795
@infastin3795 Жыл бұрын
uasm pretty much supports everything shown in the video out of the box
@ivanjermakov
@ivanjermakov Жыл бұрын
Fasm was my first thought when I saw the title, such a cool project.
@remrevo3944
@remrevo3944 Жыл бұрын
@@ivanjermakov I mostly know fasm from Tsoding, but his streams kind of motivated doing some things in assembly myself and it is definitely a good learning experience. Though sometimes I wish it had builtin support for dwarf-debug data. But I guess I will have to build something for that at some point.
@GottZ
@GottZ Жыл бұрын
PFF.. programming via strings.. just get ye little handbook of intel 8086 machine code and type down all dem opcodes by hand into a byte array. (not kidding, I've done this at a time where I did not know c had __asm__)
@megaing1322
@megaing1322 Жыл бұрын
I love how you liked how clean the first assembly looked and then suddenly started disliking it when he realized that it uses indentation... Almost as if indentation makes for easily readable code and people who dislike it don't have rational reasons for it xD.
@eveleynce
@eveleynce Жыл бұрын
it's not the existence of indentation, it's enforcing the SIZE of the indentation that sucks.
@megaing1322
@megaing1322 Жыл бұрын
@@eveleynce Hm? What language does that? And that isn't what he complained about.
@fragajjia
@fragajjia Жыл бұрын
What's the hoodie he's wearing here? I like the lining of the hood :x
@Jplaysterraria
@Jplaysterraria Жыл бұрын
From the perspective of someone who had to grade students asm code in University, I really hate renaming registers. Most x86_64 asm instructions have side effects on other registers and you can easily modify the wrong register when calling an instruction. Having to keep track of both the name and the underlying register is a pain I don't want to go through...
@marcs9451
@marcs9451 Жыл бұрын
actual x86 skill issue
@Sommyie
@Sommyie Жыл бұрын
I love ruby because you can use, or not use, {} and (). It's pure chaos
@someman7
@someman7 Жыл бұрын
Why the significant whitespace hate? Why require a whole line for the end token? Especially because you're going to indent anyway.
@MateuszAdamowski-k8b
@MateuszAdamowski-k8b Жыл бұрын
1:15 "use strict";
@ivanmaglica264
@ivanmaglica264 Жыл бұрын
Agreed, parenthesis around if statement condition is just visual and cognitive noise. They serve no real purpose and could easily be omitted. Parenthesis surrounding sub-statements to evaluate them together are still necessary.
Жыл бұрын
It’s dangerously close to python syntax… feels sexy
@seasong7655
@seasong7655 Жыл бұрын
5:00 He can't handle the python zen 😅😅
@TECHN01200
@TECHN01200 Жыл бұрын
With C, you should just compile and assemble a separate *.o file from assembly and link to that instead of using strings.
@Joorin4711
@Joorin4711 Жыл бұрын
It's called "inline assembly" for a reason. It lets you inject that special sauce when you need it without having to call a function written in assembly.
@CEOofGameDev
@CEOofGameDev Жыл бұрын
4:57 BASED
@retropaganda8442
@retropaganda8442 Жыл бұрын
Indentation with tabs is freedom for the reader, as you can choose how many columns a tab renders to, visually. Screw spaces. Screw mixed tabs and spaces, this is pure devil.
@KvapuJanjalia
@KvapuJanjalia Жыл бұрын
Reminds me of MASM (Macro Assembler).
@TheKennyWorld
@TheKennyWorld Жыл бұрын
I don't put spaces only for *if*, idk why I am just used to it
@flow1194
@flow1194 Жыл бұрын
he talking about 2 vs 4 spaces. my perrsonal discussion is 8 vs 16 and i have a shortcut for switching between them
@TheBadFred
@TheBadFred 7 ай бұрын
In the old days we had only fast assembly and slow basic.
@MrDejvidkit
@MrDejvidkit Жыл бұрын
Whitespace's significance is cool.
@OffroadTreks
@OffroadTreks Жыл бұрын
This reminds me, the original Roller Coaster Tycoon was written in Microsoft Macro Assembler by one dude.
@Fudmottin
@Fudmottin Жыл бұрын
So what are your opinions on MIX?
@skeleton_craftGaming
@skeleton_craftGaming 11 ай бұрын
In assembly, you can choose your ABI on a whim I think that the lack of () mskes python really hard to read...
@paulzupan3732
@paulzupan3732 Жыл бұрын
What exactly is wrong with significant whitespace
@styleisaweapon
@styleisaweapon Жыл бұрын
Assembly 2 was invented decades ago...a little language called TERSE and you wont believe how nice it was
@FrederikSchumacher
@FrederikSchumacher Жыл бұрын
People that feel unable to work without brace or block syntax are like "I NEED these little JAILS, they give structure and containment. Without that containment, how would I know what freedom is?". People that can deal with significant whitespace are like "Just drive to the left of the road, as long as we're all in agreement about the same side it'll work out". Go is like "Hold my beer! Here, by constitution, you have liberties, HOWEVER if I arbitrarily decide you violate one of these liberties in a way that doesn't matter except for taste, I'll put you down".
@FrederikSchumacher
@FrederikSchumacher Жыл бұрын
And Pascal is like 🤪, good riddance!
@Gregorius421
@Gregorius421 Жыл бұрын
So ASM++ ... then where's the inheritance?? 😀 Nice project though, nice syntax. In any case there's High Level Assembler (HLA) and TASM, MASM which have these features (function call and conditions), all with different syntax.
@ilionsd
@ilionsd Жыл бұрын
Imagine JS compiler/interpreter written in JS
@mumk
@mumk Жыл бұрын
Imagine C compiler written in JS
@monad_tcp
@monad_tcp Жыл бұрын
15:08 therefor Javascript is not a real programming language because V8 is written in C++. But Python is because there's a python interpreter written in python.
@JiggyJones0
@JiggyJones0 Жыл бұрын
There are also JS interpreters written in JS.
@arnaud_b42
@arnaud_b42 Жыл бұрын
Tried coding asm functions for a small 42school project... after several unsuccessful attempts to end my own life, I came to the following conclusion: When compiling C or C++ to an executable (with the appropriate flags you can get the asm code into a separate file) you can see that the compiler actually makes cleaner and more optimised code than you can possibly write yourself. Just code it in asm and also C/C++ and benchmark your asm against the compiler asm... Coding asm yourself save can save you 0.000001s in 0.000001% of the cases🤣
@Endelin
@Endelin Жыл бұрын
Haskell has significant whitespace too. 😔
@pdougall1
@pdougall1 Жыл бұрын
Just need a NASM LSP dog, good to go 😎
@m4rt_
@m4rt_ Жыл бұрын
I hate it when people don't write "Hello, World!" with the correct capitalization, with a missing comma, or even a missing exclamation mark.
@thegreenxeno9430
@thegreenxeno9430 Жыл бұрын
Construct++ when?
@georgerogers1166
@georgerogers1166 Жыл бұрын
Nice Macro assembler
@Karol-g9d
@Karol-g9d Жыл бұрын
binary code is compiled in assembler
@JonathanTheZombie
@JonathanTheZombie Жыл бұрын
Assemblers turn assembly into machine code. Compilation happens well before this.
@Karol-g9d
@Karol-g9d Жыл бұрын
Oups @@JonathanTheZombie
@martinvuyk5326
@martinvuyk5326 Жыл бұрын
Ehm, even Rust compiles to LLVM IR, which means... it still uses C++ (gcc uses C). Most languages nowadays use a compiler backend to lower to ASM. What this guy did is more or less a framework or bunch of utils to sugar coat "standard" Assembly (RISC instructions that basically any CPU architecture supports), you still would be able to use custom ASM commands for each architecture.
@soniablanche5672
@soniablanche5672 Жыл бұрын
"When you program with string" oh so like SQL ?
@SimGunther
@SimGunther Жыл бұрын
3:57 Wait until he finds out that this is literally block parameters, which is used in Swift's SIL 🤯 Also in 10:14, term rewrite systems usually are layered from the most fundamental blocks like functions & modules all the way down to the tiniest of statements.
@MrZombastic
@MrZombastic Жыл бұрын
u mean jdasml? toms a genius
@mierenmans
@mierenmans Жыл бұрын
this assembly language feels a lot like webassembly text but made for native cpu's lol
@GRHmedia
@GRHmedia Жыл бұрын
90% of programming languages use another compiler to compile them most use C or C++. python, java, js, lisp, lua, ... Rust was originally Ocaml which was originally written in C. At least Rust can compile itself now though.
@eveleynce
@eveleynce Жыл бұрын
lua actually does have a lua compiler, but since lua is *by definition* interoperable and embeddable in C, it makes sense to just compile it with C too, helps with the compatibility
@VivBrodock
@VivBrodock 10 ай бұрын
is the meme going to be that he just recreates an already existing language?
@alexkozliayev9902
@alexkozliayev9902 8 ай бұрын
That guy just invented C
@skeleton_craftGaming
@skeleton_craftGaming 11 ай бұрын
1:35 That's literally the same code...
@stzi7691
@stzi7691 Жыл бұрын
Wait till he finds out how easy it is to implement a FORTH compiler. Might be an Ocaml distraction again 🙂.
@Sommyie
@Sommyie Жыл бұрын
I work in DevOps and was shown a project at work that's using.... React.... And.... Node.... And i almost laughed. Ugh, i have to automate the damn builds.
@JoshuaF.
@JoshuaF. Жыл бұрын
rust is for ####### who don't know how memory work. C++ is for ####### who don't know how to write code that works. C is for ####### who can't write assembly. assembly is for ####### who don't write machine code. machine code is... uhhh, hm. point is, we're all ####### who don't wanna write machine code.
@RohithCIS
@RohithCIS Жыл бұрын
So... what Assembly is to C, is what C is to Python? With the string meta programming and all?
@mohammedalmahdiasad6832
@mohammedalmahdiasad6832 Жыл бұрын
it will be useful if it is the other way around and used in reverse engineering ide
@andru5054
@andru5054 Жыл бұрын
let's goooo
@dranon0o
@dranon0o Жыл бұрын
> Accidentally create C there fixed
Жыл бұрын
6:45 by this logic js is not a real language...?
@shapelessed
@shapelessed Жыл бұрын
1:22 - Ever had to deal with GLSL shaders in JS? ThreeJS, babylonJS, all that stuff? No? Then let me tell you. Your GLSL is done purely in strings unless you go out of your way to split it up to dedicated shaders and fetching them just to have IDE support... Programming with strings is truly next level garbage.
@NexusGamingRadical
@NexusGamingRadical Жыл бұрын
@1:30. Thats SQL tho
VIM - I DIDNT KNOW THIS!!! | Prime Reacts
18:27
ThePrimeTime
Рет қаралды 98 М.
Case Of The Sabotaged Trains | Prime Reacts
31:28
ThePrimeTime
Рет қаралды 81 М.
Their Boat Engine Fell Off
0:13
Newsflare
Рет қаралды 15 МЛН
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН
$1 vs $500,000 Plane Ticket!
12:20
MrBeast
Рет қаралды 122 МЛН
Threads In Ziglang | No Talking Asmr Coding
2:39
xfxpositions
Рет қаралды 3,9 М.
I Animated VIDEOGAME Icons in Blender 3D
17:59
bytedozer
Рет қаралды 918
Why i think C++ is better than rust
32:48
ThePrimeTime
Рет қаралды 346 М.
Exploring a generic spiral LED light - with schematic
10:52
bigclivedotcom
Рет қаралды 9 М.
Wisdom From Linus | Prime Reacts
12:18
ThePrimeTime
Рет қаралды 529 М.
Do NOT contribute to open source | Prime Reacts
36:40
ThePrimeTime
Рет қаралды 297 М.