Prime Reacts: Creating JSF#*!

  Рет қаралды 70,070

ThePrimeTime

ThePrimeTime

Күн бұрын

Пікірлер: 131
@amr3162
@amr3162 Жыл бұрын
0:37 creating a slice of a string in V8 just creates a `SlicedString` object which is like a `string_view` it only contains reference to start and end. This actually leads to some funny and unexpected results like when you take a small slice of a 100mb string, the garbage collector in V8 is not able to collect the larger string because the SlicedString holds a reference to it.
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
that was my suspicion and i wish i would of said that because this comment would of been amazing!
@vytah
@vytah Жыл бұрын
@@ThePrimeTimeagen Fun fact: Java used to work like this until version 7 update 6, when it started to copy the substring into a new array. Yes, it was a change in a patch release, and yes, tons of code that relied on the previous behaviour suddenly started sporting quadratic performance instead of linear. According to the API, both behaviours are correct, so theoretically it was the API users' fault that they were relying on undocumented behaviour.
@fulconandroadcone9488
@fulconandroadcone9488 Жыл бұрын
When he asked the question I thought about and 15 seconds latter I thought, well how do you handle that in a garbage collector? Do you split the string in 3 parts so only one can be retained? How do you handle that? Ah well I guess they would do just a copy and have some parts of the string duplicate. Guess not.
@GameJunkiesChannel
@GameJunkiesChannel Жыл бұрын
Both of us watching vids at 1.5x ain't going to cut it!!!
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
yeah, i have since stopped doing that
@GameJunkiesChannel
@GameJunkiesChannel Жыл бұрын
@@ThePrimeTimeagen Luv the vids!
@catalinoprea5313
@catalinoprea5313 Жыл бұрын
:)))))
@VivekYadav-ds8oz
@VivekYadav-ds8oz Жыл бұрын
for some reason this reminds me of the TCP over TCP problem.
@ronniebasak96
@ronniebasak96 Жыл бұрын
2.25x
@godowskygodowsky1155
@godowskygodowsky1155 Жыл бұрын
In college, my systems professor once said, "If you're programming in a high-level language like C..." I forget what the context was or how that sentence ended, but those words will echo in my head until the day I die.
@goblincrimes8524
@goblincrimes8524 11 ай бұрын
Any language is high level if you program by switching individual bits on and off
@W0lfCL
@W0lfCL 8 ай бұрын
I bet ur college professor was an experienced computer scientist from 1970's-80's who coded in machine code, a, b and assembly Ofc C is high level for him
@VivBrodock
@VivBrodock 8 ай бұрын
did my man insert punch cards into his room sized computer?
@kirbykilledgod
@kirbykilledgod 4 ай бұрын
In an exam I had to write C was a high level language because you were not manually changing registers, it drove me so mad
@heron619
@heron619 Жыл бұрын
Imagine having such a low level in depth understanding of a language that even Prime is impressed by it just to use it to create a meme JSF*ck compiler. What a flex!
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
such a flex
@theshermantanker7043
@theshermantanker7043 Жыл бұрын
Well, easily doable if you're bored enough to read the language specification
@seannewell397
@seannewell397 Жыл бұрын
I love it when you realized about interpolated property access via indexing. Your brain aligned but your heart sank.
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
hah, it hurt so good
@techwithattila
@techwithattila Жыл бұрын
Happy that today I learned something which I can use in my team’s codebase. I’m sure they will like it
@DesTr069
@DesTr069 Жыл бұрын
Imagine you see there’s a new PR up, one file added, +200k lines, you run it and it just logs a message LMAOOO
@xarunoba3894
@xarunoba3894 Жыл бұрын
For "obfuscation purposes"
@kahnzo
@kahnzo Жыл бұрын
Your face at 9:56 is amazing. This is the reason that I watch these mostly throwaway videos, that moment that you realize the horror....
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
haha, it hurts once you realize what's happening
@Richard-sp3ul
@Richard-sp3ul Жыл бұрын
Hey buddy on Banana: as an English from Bristol. We say put wa'er in the baff. We don't mess about in 'Brizzle', we just say bannaner . On another note so much of the code community is defined by American English and thinking, as an English, I still have to process what you hell you guys are talking about. But I love it.
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
haha! LOVE THIS RESPONSE
@marcotroster8247
@marcotroster8247 Жыл бұрын
If you watched the video until the end, you would have seen the guy transpile his transpiler into JSF*ck as well which makes it even more funny because he actually deduced an entire language with his charset 😂
@channel_zero
@channel_zero Жыл бұрын
I have never seen Prime be so shocked and appalled and impressed simultaneously. At 10:08, you can see th- entire head-brain explode.
@PhilipAlexanderHassialis
@PhilipAlexanderHassialis Жыл бұрын
10:05 "He is beginning to believe" 15:31"Do you want to know more?"
@KyleHarrisonRedacted
@KyleHarrisonRedacted Жыл бұрын
10:50 I remember the first time learning a similar “trick”/“language feature” in php that lets me just dynamically reference an object BY string and thus access any members that dynamically. I wondered.. JavaScript could do that.. And sure enough it could. But in was a flash Developer at the time, and knowing ActionScript2 was based off ECMAScript just as JavaScript was.. sure enough… could do it there too. I suddenly became way too loose and dangerous with that knowledge lol
@M3R14M.
@M3R14M. 9 ай бұрын
3:20 LOL, the guy is so obviously not British. By the way he pronounces words ending with 'd', I'd say his native language is Dutch.
@SimGunther
@SimGunther Жыл бұрын
TECHNICALLY you could write low level stuff in JS or Haskell, but the results are...macabre to say the least.
@el.bromas
@el.bromas Жыл бұрын
macabre
@kellybmackenzie
@kellybmackenzie Жыл бұрын
Haskell actually has really good C interop! And it has pointers too. You can do manual memory allocation/management with Haskell just fine (in the IO monad, of course), it just sadly isn't fast as C (for obvious reasons). GHC (the main Haskell compiler) has a lot of tools that make it really easy to call C from Haskell and vice versa, it's super neat! The only downside is that cross-compilation is really hard with GHC.
@HelloThere-xs8ss
@HelloThere-xs8ss Жыл бұрын
This was actually the primary way JS was to be written. The people got it wrong.
@tokiomutex4148
@tokiomutex4148 Жыл бұрын
let first = undefined;
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
GET EM, and i love you my little, safe mutex
@7heMech
@7heMech Жыл бұрын
If they only compiled the compiler, it would have been perfection.
@DrewryPope
@DrewryPope Жыл бұрын
"you don't make a compiler by accident" ehehehehehehe are you sure
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
yeah, i was caught off guard by that
@theodorealenas3171
@theodorealenas3171 Жыл бұрын
This is one of the things where C would actually be easier to use for. Because chars are one byte integers. I don't know, but the same tricks would probably be much easier.
@RunningRay9
@RunningRay9 Жыл бұрын
but even if it's easy to construct any string, i don't think in C you can run strings as code tho
@dancom6030
@dancom6030 Жыл бұрын
This sort of thing would be impossible in c because it's a compiled language with no type coercion.
@theshermantanker7043
@theshermantanker7043 Жыл бұрын
​@@dancom6030Type coercion is literally everywhere in C, there's a reason it's a weakly typed language
@dancom6030
@dancom6030 Жыл бұрын
@theshermantanker7043 yeah idk what I was saying lol. Technically this kind of thing actually is possible because global strings in C are executable. It's just that that code would then be highly platform dependent.
@mario7501
@mario7501 Жыл бұрын
I have never written javascript, but I'm also no longer surprised that I haven't been able to switch Microsoft accounts when logging into Microsoft teams without deleting my browser cache.
@fulconandroadcone9488
@fulconandroadcone9488 Жыл бұрын
I don't think that has as much to do with JS as it has to do with Microsoft
@rthurJ
@rthurJ Жыл бұрын
It's really only missing a benchmark, pretty sure going low level like that is going to yield some sweet performance gains /jk
@theodorealenas3171
@theodorealenas3171 Жыл бұрын
lol. I made a BF program once which did division, and to divide 2 digit numbers it took like half a second? I don't remember. That was BF, not JSF.
@elin4364
@elin4364 Жыл бұрын
I mean in the end its basically just eval-ing a string of normal js code right? So once you've parsed through everything it should be reasonably fast
@dus10dnd
@dus10dnd Жыл бұрын
"It sucks to invent something and also get it wrong." So much truth!
@EwanMarshall
@EwanMarshall Жыл бұрын
I would point out, we figured this out in C ages ago, and there are so many ways to do it there we ended up with the international obfuscated c code contest, ioccc :D
@shimadabr
@shimadabr Жыл бұрын
Imagine an employee rage quitting a small company and changing an entire project to work based on this unholy implementation haha. Wrap everything to work like this underneath the hood and only the next cursed employee would notice it hahaha.
@seannewell397
@seannewell397 Жыл бұрын
The feels when he reached for hex! THE FEELS
@DriveandThrive
@DriveandThrive 5 ай бұрын
Extreme extreme JS : we can convert all of JavaScript to only Zero's and one's and write anything mind blown**
@NuncNuncNuncNunc
@NuncNuncNuncNunc 11 ай бұрын
@3:25 Don't get Prime started on how brits say "bag" or "flag." JS: true + "0" = "true0" Also JS: true + true + "0" = "20" and since addition is commutative: Also JS: "0" + true + true = "0truetrue"
@antsii
@antsii Жыл бұрын
love that winky winky after you got all that delicious food
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
its the best way to live your life
@godowskygodowsky1155
@godowskygodowsky1155 Жыл бұрын
3:10 Intrusive R and linking R are common in SBE because Anglophones hate vowel hiatus.
@JackDespero
@JackDespero Жыл бұрын
I read "JSF" and my brain went to "JeSus, Fuck".
@danser_theplayer01
@danser_theplayer01 2 ай бұрын
Mfer out there writing code in Galactic Basic language from Star Wars.
@rumplstiltztinkerstein
@rumplstiltztinkerstein Жыл бұрын
We should create a transpiler that converts javascript code into that format.
@KnightMirkoYo
@KnightMirkoYo Жыл бұрын
This video literally shows it in the end :)
@luisguilherme2403
@luisguilherme2403 Жыл бұрын
Bro just summoned food in the middle of the live
@psilogismo30
@psilogismo30 Жыл бұрын
The cool thing: JSF#* behaves more consistently than vanilla js!
@andythedishwasher1117
@andythedishwasher1117 Жыл бұрын
I've seen this before and I took it as a kind of thesis on how Javascript is a high level language for a reason. Tbh, it was the first language I was exposed to and I find myself increasingly disliking it the more I explore outward. It's a language made of hacks because 90% of its history consists of people hacking it to do stuff it wasn't previously designed for.
@beebakrizzle
@beebakrizzle Жыл бұрын
Make a jsf interpreter in Rust for blazing fast performance
@ab.3800
@ab.3800 Жыл бұрын
I rewrote this “compiler” in about 500 lines of C
@derzw3rg
@derzw3rg Жыл бұрын
At 10:08 prime had a small meltdown.
@AndrewTSq
@AndrewTSq Жыл бұрын
Imagine first day at work, and you have to debug jswtf code :) ive seen this been used to obfuscate code for malware, since the virusscanner dont have any idea what is going on.
@RedHandedBug
@RedHandedBug Жыл бұрын
"I am that guy" - ThePrimeagen
@ko-Daegu
@ko-Daegu Жыл бұрын
This is helpful really helpful for obfuscation when we pentest web apps
@TeodorDimitrov1991
@TeodorDimitrov1991 Жыл бұрын
Please watch videos at 1x speed.. otherwise love the content
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
i have stopped doing this as it doesn't allow people to speed tihngs up :)
@xdman2956
@xdman2956 Жыл бұрын
its funny to me that you have to get backslash character despite it being in the character list
@jacoblockwood4034
@jacoblockwood4034 Жыл бұрын
btw for the ppl in chat who are all WRONG: brainfuck is not inspired by javascript, jsfuck is inspired by brainfuck. sorry for the nitpick
@yeahaddigirl
@yeahaddigirl Жыл бұрын
Feed the source compiler into the compiler and make it self contained
@seannewell397
@seannewell397 Жыл бұрын
THE FUNCTION CTOR Goooood damn this guy
@suman_js495
@suman_js495 6 ай бұрын
Really? Is there a compiler that can turn the normal js into that? 😮 If it does can you share the name of the compiler? Thanks
@martijn3151
@martijn3151 Жыл бұрын
The start of the video was right, this truly was some low level JS code trickery.
@soyitiel
@soyitiel Жыл бұрын
Video should have ended at 21:49
@CaptainWumbo
@CaptainWumbo Жыл бұрын
the only usecase for this is obfuscating malicious code. Probably a little more subtly than running the whole application through this, but you could probably sneak a line into an open source project abusing coersion and claim you're a genius who is just doing fast inverse square root.
@ExpertOfNil
@ExpertOfNil Жыл бұрын
Low Level Learning is shaking his head in disgust right now 😝
@draguve3821
@draguve3821 Жыл бұрын
This is high level rop chaining
@samtv19981
@samtv19981 Жыл бұрын
Haha I hoped you would cover JSF (Java Server Faces).
@loganhall1529
@loganhall1529 Жыл бұрын
God had no hand in this
@heron619
@heron619 Жыл бұрын
Bananer
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
got me
@hexdiqoreprime7974
@hexdiqoreprime7974 8 ай бұрын
Now this is code.
@ofeenee
@ofeenee Жыл бұрын
You can turn an open source JavaScript into a closed source JavaScript available publicly using this compiler. 😂
@kebien6020
@kebien6020 Жыл бұрын
Not really, if you just remove the () at the end you get a function instead of calling it. You can then call .toString() on the function and get the decoded source code. For reversing any JSFuck compiler output, and not specifically this one, there is also the option of monkey-patching eval and Function.prototype.constructor to print out their input before eval'ing it. Kinda like this const original = Function.prototype.constructor Function.prototype.constructor = code => { console.log(code); return original(code) }
@isaakarslan9485
@isaakarslan9485 Жыл бұрын
I thought this video was going to be about primagen implementing Java server faces in rust 😂
@ollystoppa9155
@ollystoppa9155 Жыл бұрын
Is this a payload obfuscation masterclass?
@Ironication
@Ironication Жыл бұрын
God, I love this language.
@xBZZZZyt
@xBZZZZyt Жыл бұрын
00:40 which JavaScript engine?
@Veptis
@Veptis 11 ай бұрын
Hrey hoodie prime? Is this how esolangs started?
@JacobCanote
@JacobCanote Жыл бұрын
No words!
@Kavukamari
@Kavukamari Жыл бұрын
no words, only ()[]+!
@draakisback
@draakisback Жыл бұрын
I think I want to write a lisp compiler using a JS fuck compiler. I've seen this video before but it's always impressive. Seriously though this is probably the biggest fuck you to any serious JavaScript evangelist. Every time they say their language is so great and so safe, all you have to do is show them this.
@venc0r
@venc0r Жыл бұрын
I'm dying here
@ThePrimeTimeagen
@ThePrimeTimeagen Жыл бұрын
in a good way?
@Ikxi
@Ikxi 9 ай бұрын
why at 1.5x??
@danser_theplayer01
@danser_theplayer01 2 ай бұрын
They meant low level OF javascript.
@seannewell397
@seannewell397 Жыл бұрын
Legend
@romanmaciel8072
@romanmaciel8072 Жыл бұрын
Cool but is that a default dunst notification I see in the corner? Real programmers rice.
@JhonatasRosendo
@JhonatasRosendo Жыл бұрын
I clicked thinking this was gonna be about Java server faces 😅
@4idenn
@4idenn Жыл бұрын
Why is this even possible...?
@economicist2011
@economicist2011 3 ай бұрын
3:15 He's Bri'ish. He can't help it.
@venc0r
@venc0r Жыл бұрын
add a stream command !js for it
@theideaot
@theideaot Жыл бұрын
Like for the floating sandwich
@vimaximus1360
@vimaximus1360 Жыл бұрын
just use rust
@Deepfri3d
@Deepfri3d Жыл бұрын
Bloody Rust developers, telling us how to talk in English. Stick your Banana in a compiler Developer Disrespect. Still better than that Theo guy though.
@unusedTV
@unusedTV Жыл бұрын
This guy sounds Dutch, not British.
@sadboisibit
@sadboisibit Жыл бұрын
By "low level JavaScript" I really hope they mean all the C++ under the hood.
@TomasKonrady
@TomasKonrady Жыл бұрын
try THIS with Rust
@0644dev
@0644dev Жыл бұрын
Primeagenanar
@yuriblanc8446
@yuriblanc8446 Жыл бұрын
baNaNa
@m1kr0kosmos
@m1kr0kosmos Жыл бұрын
the letter d is *bloat*
@HaKazzaz
@HaKazzaz Жыл бұрын
Hey Prime, I'm gonna save this vid for later when I'm next to a 70' TV. Thank's for not full screening a coding video :)
@brunomello7499
@brunomello7499 Жыл бұрын
first hehe
Prime React: The Story of TypeScript
15:02
ThePrimeTime
Рет қаралды 67 М.
Work Life Balance | Prime React
43:57
ThePrimeTime
Рет қаралды 164 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 11 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,1 МЛН
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 29 МЛН
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 3,9 МЛН
How Slow Is JavaScript? | Prime Reacts
15:34
ThePrimeTime
Рет қаралды 183 М.
Prime Reacts: 7 Days to make a WebSite
12:06
ThePrimeTime
Рет қаралды 157 М.
fixing bugs - rust later?
3:52:51
badcop VODs
Рет қаралды 424
I am a Bad Software Engineer | Prime Reacts
26:06
ThePrimeTime
Рет қаралды 179 М.
C Is Not A Language Anymore
34:29
ThePrimeTime
Рет қаралды 243 М.
TS vs JSDoc | Prime Reacts
22:11
ThePrimeTime
Рет қаралды 96 М.
IM DOING JAVASCRIPT
1:10:47
TheVimeagen
Рет қаралды 24 М.
Prime Reacts: The Story of React
31:44
ThePrimeTime
Рет қаралды 132 М.
Is JSON Blazingly Fast or...?
9:57
ThePrimeagen
Рет қаралды 195 М.
UI Libraries Are Dying, Here's Why
13:28
Theo - t3․gg
Рет қаралды 321 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 11 МЛН