- Видео 9
- Просмотров 102 322
Kronark
Германия
Добавлен 2 июл 2024
Hello, we are Kronark. This channel will be used as an archive of sorts for development logs of any kind.
Syscall Machine Code without an Assembler - Kronark
System Calls are an essential component of any piece of software. Regardless if you want to open files, use multiple threads, write to the console or send data through the network: you will need some system calls. Today we'll briefly cover how we can use the Kronark Compiler to generate the corresponding machine instruction for the x64 architecture. Next up is the MOV instruction to actually pass some parameters!
Learn more about x64 Instruction Encoding here:
ruclips.net/video/FL7WPsE-BuE/видео.html
Learn more about the x64 SYSCALL assembly instruction here:
www.felixcloutier.com/x86/syscall
0:00 Title
0:10 Intro
0:40 System Calls
1:41 Implementation
2:30 Outro
2:45 Endcard
Music by Symbology Cinem...
Learn more about x64 Instruction Encoding here:
ruclips.net/video/FL7WPsE-BuE/видео.html
Learn more about the x64 SYSCALL assembly instruction here:
www.felixcloutier.com/x86/syscall
0:00 Title
0:10 Intro
0:40 System Calls
1:41 Implementation
2:30 Outro
2:45 Endcard
Music by Symbology Cinem...
Просмотров: 2 437
Видео
Building Executables without a Programming Language - Kronark
Просмотров 4,9 тыс.Месяц назад
Today we harvest (some) of the fruits of our labour over the past two months: We are building an empty executable, ready to be injected with our very own node based code. Learn how the Kronark Compiler can be used to construct a complex file format such as the Portable Executable (PE) format for the Windows operating system. This is only the first major step of a long journey towards a textual ...
The Rarest Feature in Node Editors: Node Graph Activation - Kronark
Просмотров 4,3 тыс.Месяц назад
Node graph activation is a key mechanic in my compiler / node graph editor. It is what allows a user to combine different functionalities without having to deal with an explosion of complexity in the frontend of their nodes. It's also a feature that appears to not be available in all major node graph editors out there! So join me on this (for now) last exploration into compiler fundamentals, be...
A Type System to Rule Them All - Kronark
Просмотров 3,5 тыс.Месяц назад
In this second explanatory video we cover the underlying type system that governs the validity of node connections. The so-called "Type" node not only allows for the intuitive usage of built-in types provided by the compiler, it also allows absolute freedom for creating any custom data type you could imagine. In contrast, the so-called "Option" nodes provide an intuitive interface for enumerati...
Designing Node Inputs using Port Nodes - Kronark
Просмотров 3,7 тыс.2 месяца назад
As requested by the majority of you humans, here is a first explanatory deep-dive into the inner workings of my node graph compiler. In this video we'll discuss how so-called "Port" nodes can be used to build the input fields / sockets of custom nodes. Feel free to ask any further questions in the comments below! 0:00 Title 0:10 Warning 0:19 Intro 0:47 Direction 1:09 Channel & Value 1:37 Node S...
Introduction to Portable Executables (.exe Files) - Kronark
Просмотров 11 тыс.2 месяца назад
We're slowly fighting our way to building executable code from absolutely nothing. In this, arguably very dry topic of a video we'll tackle the basics of the portable executable format! It'll get more exciting later on, I promise... 0:00 Title 0:10 Intro 2:04 DOS Legacy 3:22 Signature & File Header 4:46 Optional Header 8:11 Sections 9:29 Conclusion 9:45 Endcard Music by Symbology Cinematics: ww...
Assembling x64 Instructions from Scratch - Kronark
Просмотров 11 тыс.2 месяца назад
In this video we'll be tackling one of the biggest hurdles in front of us: the encoding of x64 instructions. Once we get this running, we'll be one step closer to implementing some actual operations and therefore programming using the Kronark compiler! 0:00 Title 0:10 Intro 1:00 Opcodes 4:28 Rex Prefix 5:38 Legacy Prefixes 6:59 ModR/M 9:08 SIB 10:13 Displacement and Immediate 10:57 Conclusion 1...
Writing Software without a Programming Language - Kronark
Просмотров 52 тыс.2 месяца назад
Join me on a journey of reinventing absolutely every wheel I can get my hands on! Sometimes you just got to start fresh, you know? 0:00 Title 0:10 Introduction 1:03 The Plan 1:58 Node Editors 2:55 Compiler Basics 4:45 Endcard Music by Symbology Cinematics: www.youtube.com/@Symbology-Cinematics Sound Attributions: soundcloud.com/x3nus
Integer Types from Scratch - Kronark
Просмотров 9 тыс.2 месяца назад
Before we can really do anything else, we need some data to work with! So let's quickly build some simple integer types using the Kronark Compiler. Writing software without a programming language: ruclips.net/video/qM2mtAPEmd4/видео.html 0:00 Title 0:10 Introduction 0:38 The Plan 1:08 Implementation 2:08 Teaser 2:20 Endcard Music by Symbology Cinematics: www.youtube.com/@Symbology-Cinematics So...
This looks awesome! It would be nice to see intermediate values of computations in the nodes/ports itself.
Thank you! There is an inspector tool within the compiler, which I just don‘t show in the videos. More user-freindly features will be added in the release build we‘ll be making together using this prototype :)
Talking about readability, about intersecting edges specificaly -- you can not totaly avoid them, you won't be able to create some programs without them. But you can be clever about them. I'm currently working on IDE for a flowchart language that was made in the 80s. The authors solved this problem in really clever way -- they had put all the intersections in one place😄. It's hard to explain here what exactly they have done, but if you'll ask me, I'll try my best.
You can actually, already found a solution for that :)
@@Kronark, well, than I'm waiting to see that in the next video :)
Don‘t have time to work on the compiler code rn, need to get a renderer prototype for my thesis done first - just doing some assembly at the moment :) But will cover the new features eventually, maybe towards christmas?
@@Kronark, I would love that!
Wow. I'm actually writing a gaphical language for my thesis too. But slightly higher-level one. I wanna compile flowcharts. Each flowchart consists of icons. There are three main types of icons -- Action, Question and Choise. Each has ouly one input line -- it goes from the top, and always has at least one output line that goes to the bottom, so program flows nicely from top to bottom, and eveything branching goes to the right, no messy arrows needed. Question has two outputs, one on the bottom, one on the right, one Yes, one No, you can choose which is which. Chose is analogus to c++ cwitch-sace and Rust match -- it consists of one sub icon on top that shows what's being choisen and horisontal line of sub icons that represent what to choose from. That flowchart language wasn't developed by me, but it's hard to find any working IDE for it and it always consists of mixing it with other languages, like you write your C/C++ code in the icons, you organize your program as the flowchart. I wanna create one standalone language, that defines both flowchart and text inside icons. I also wanna add scopes to the flowchats.
Sounds cool! Keep me up to date! :)
Thank you so much for your content and uploading I love it !
Thank you for the kind words! :)
A calling convention, afaik, is not (only) the order but the whole process methodology.
Would‘ve only over-complicated things if I had started describing that return values etc are also part of the convention
I like thos shorter form video as it is easier to understand and also we can have more frequent updates. Love your channel!
Don't know about more frequent just yet, but will be ramping up everything once the master's thesis is done. :D Glad you like it here!
This is a cool project! Do you think you will implement optimizations as well; for example, Template Metaprogramming?
The concept of template metaprogramming is already natively supported by this code design approach :) But yes, we'll be building some framework nodes to make such a task easier. And thanks!
@@Kronark this is true, it is a concept with many underlying principles.
0:57 I believe the equation is missing a few definitions
It's just a quick visualisation of what I have to deal with for my master's - isn't supposed to be understood in any way :)
Can you put the Dune theme in the background of one of your videos?
Wanna avoid that copyright issue to be honest :P
@@Kronark Would be nice though.
Indeed
Very complex
Wouldn‘t be fun otherwise
@@Kronarkto be honest, I don’t really understand the flow of the interface in the video, somewhat esoteric, maybe a human readable output/pseudocode of the node graph side-by-side would be nice!
Do you mean the node graph in the second part of the video? There are some explanatory videos in the "Compiler" playlist that explain most of what's on screen there - might want to check those out. They're already human readable, just different enough to not be immediately understandable when you're coming from text-based coding. There isn't really a pseudocode analogue to this because it isn't actual code, it's a definition of bytes ^^ A rough equivalent would be "return 0x0f05;", which is so short you might as well not show it in my opinion :)
Very promising stuff you have here :))
Thanks!
@darkfllame wya
Love this 😂😂
Can you share the kronark compiler, we would love to play around
I probably won‘t share this prototype any time soon as it simply is too buggy currently. I don‘t have time to fix bugs much at the moment due to my master‘s thesis. I‘d really like to at least get a head-start in software development before releasing the only ace up my sleeve to the public.
@@Kronark I'd happily support you on some patreon thing to get this going after your master's thesis! 🤞
Appreciate it! I‘ll consider setting one up next year - there have already been a couple of comments regarding that. Definitely want to get at least another couple of months of the whole youtube experience under my belt before monitising anything - I‘ve only been doing this for 2,5 months after all, feels a little early to earn money from all this 😅
It would probably be better to set up a discord first.
Definitely. It's already in motion, just have to find the time to set it all up and test it properly. Don't want to half-ass it. It's going to be available before Christmas - probably way sooner as I may want to work on some math stuff for computer graphics with some of you.
Finally a video I can understand without constantly rewatching every paragraph ^_^
Hope it was still worth the watch :P
This looks so promising, i hope i can use this with linux someday or if its got to be windows that it works with wine/proton
It‘ll be compatible with any OS eventually, including Linux :) The whole Windows focus right now is simply because I have a Windows machine.
I'm kinda obsessed, rewatching fifth time already 😅 Hope you'll create discrod soon 😊 Also, I have another question! Do you plan on implementing graphics from scratch, like spaerophoria does in his "Demistifying the linux graphics stack", or will you use bindings to Vulkan/Metal/WebGPU? Or maybe both????
Also it seems I'm not the most attentive rewatcher 😅 Vulcan it is then)
But it would be interesting to see natively supported GPUs directly within your language
Ah I was wondering where all the watch-hours were coming from 😉 Yeah will probably set that discord up soon-ish. Might even be helpful to me for some math questions, since you all are a smart bunch… so maybe sooner than later! I generally want to go as low level as possible, so we may eventually try to build our own bindings of sorts. But yeah, for now vulkan is my go-to, since I want to get things on screen first. The more visual part of computer graphics will be a nice break from low level compiler stuff, which I desperately need to be honest 😅
How will memory management look? Will it be manual as in C? Or will it use a borrow checker, like in rust?
First stages will be manual since that simply is a lower level of abstraction. We‘ll implement a borrow checker approach later on though!
I'm so hyped for your language! I hope you have a good time building it!
Glad to hear it! Gonna be a rough couple of months coming up with my master‘s thesis taking up most of my time, but it‘s going to be fun once I‘m through with all the distractions :)
i see that the node-graph design potentially accommodates any file format. i wonder if you have explored any other cpu architectures or operating system, is there an environment that is more "streamlined" for node-graph design?
Not yet, but all the other cpu architectures and OSs wouldn‘t be super different - especially in regard to operating systems, the only real difference is the numbers used for some system calls. In terms of machine code instructions, different architectures would obviously require different byte sequences - but at the end of the day the overall approach is identical. This node graph design is pretty much applicable to any target format equally.
I'm intrigued to see how you manage to do things like optimisation and register allocation that traditional compilers need to use loops and recursion for. That will be several videos down the line though.
Looking forward to do some optimisations as well! But yeah, like you said, make it work first, then optimise :D
Is there estimate for when this is release to public? I would love to have access to this and try out.
A proper release build will be built using this prototype, which needs to be feature complete first. A conservative estimate would be another 2 years minimum. I may give access to the prototype at some point earlier via patreon or something like that.
Can this be used to create OSes? Since they are too, just sequence of bytes;)
Yes :)
What if for example the conditional parameters depend on an integer being signed vs unsigned, but that is not known at compile time?
Generally that information is known due to specific signed / unsigned integer types. But yes, if something isn‘t known at compile time, then the nodes can‘t react to that. If the type isn‘t known but the data is, then a simple „less than zero“ operation can be done via the condition node (in the case of signed / unsigned numbers) :)
There is a good video by Inkbox that is called "What is the Smallest Possible .EXE?". This can give a good idea of what is minimally needed to have a runable exe file. Another video by Nir Lichtman called "Making a Very Minimal Windows Executable in C" also has some good information in it.
Yesss I‘m aware, thanks! As far as I know, the smallest possible file is in the double digits I think? A little over 64 bytes? I think I just read that on stack overflow somewhere though… Might consider those techniques for fun some day, right now I just want my output files to not contain the entire standard library for a start :D
I just found your channel. My question is, Why PE when ELF is probably better documented and even has official source available in the Linux kernel you can check to see how it works. Where as PE you need to just go on documentation. There is no source availability to know how the file is being read by Windows its self short of looking into a system like ReactOS possibly. Your system looks very adaptable and, as you said at the start of the series, could be used to make any file format.
Because I have a windows pc and no linux system available. Additionally, Windows is the dominant OS on the software market, even more so on the gaming market. So it‘s just more sensible to start developing for Windows once I get into the software and game development business. I‘ll obviously support ELF eventually, but definitely only once I can actually run it on a system without having to setup virtual environments for it. May get a Linux laptop next year for that :)
Also welcome to the channel :D
I like the changes you made to your videos, but I especially like the back and forth with your community through posts on RUclips. Please keep it that way! :)
I definitely will, the feedback is invaluable :D
I think with this language/compiler CRDT and graph/AST-based CVS (because code is already parsed and always valid AST-graph) also will work good. For online collaborative work, like in Figma. Probably for most cases conflict-free merge could also be done with seamless history (automatic commits into branches - you assign commit messages only to meaningful points in history sequence)
I wonder how you will separate frontend and backend compiler later for cross-platform code? You will need some abstract intermediate representation. But ports basically give some idea of how it can be done
Sorry, I don't quite understand? What do you mean with "separate FE and BE for cross-platform"?
@@Kronark I'm sorry for my bad english. I just didn't understand how it would be possible to write code that could be compiled for different architectures (you mentioned x86/64, arm and riscV, I think), but which would not include architecture-specific modules. But after some thinking I already catch up how to do that with features of your node-lang. So my question partly outdated and new details in future videos will complete the picture, I think
@@dmitry-diehl All good mate, your English is fine. This compiler basically moves the compiler target implementation into user-code space. So if a user wants to target a different architecture, he/she just has to build some nodes that output instructions for that architecture correctly. It will all become much clearer the more applied topics I upload :)