#How people develop these actually? Like how do they start?

1 messages ยท Page 1 of 1 (latest)

wanton flume
#

I went through this app known as ghostty which is terminal emulator written in zig, which uses gpu to render. The author uses another library which is written by himself known as xev which is a non blocking io. Like the author knows core concepts like OS, Terminal (PTY, TTY), GPU programming, Threads, Async IO. These are independent concepts and very hard concepts.

https://github.com/ghostty-org/ghostty/

GitHub

๐Ÿ‘ป Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration. - ghostty-org/ghostty

prisma whale
#

Generally one starts with the basics. A good old hello world.
From there one branches out into other topics, like file reading, or networking, or just prodding at rendering graphics, audio or whatever.

With enough fooling around one finds out various tricks and gets experienced in the language but mainly in how to approach a project.

Personally I spend around 50% of the time pondering layout/structure, reading documentation and writing my own for the project.
Actually coding happens when one knows how to roughly approach the project at hand.

bleak garnet
#

Ghostty wasn't built in a day its been worked on for 3-4 years at this point (maybe even longer)

like the readme states for libxev it was influenced by io_uring and other async event libraries like libuv so its not a totally new concept.

There are also multiple resources to learn about low level terminals and xterm is MIT licensed so there is alot to study from there

Ghostty has evolved significantly since its early days back then it was a glfw only application

wanton flume
prisma whale
#

I can also agree with @bleak garnet.
Projects are rarely a "write once and it works" type of deal. Usually one does improvements and additions over time, restructure and over time get something working.

bleak garnet
wanton flume
#

But how many days I keep on reading docs, reading source code. Like it's kind of demotivating.

#

I literally don't know the core concepts and if I start learning them it will take years

bleak garnet
prisma whale
#

I normally go back and forth.

I am currently writing an HTTP server myself.
So I read documentation for a given function, write the code to make it do the most basic thing it is supposed to do. See if it works, if I understand it.

Each aspect of a project has its own "hello world" project of sorts, where one learns the thing at hand.
Later on one can combine these puzzle pieces of knowledge into a unified project.

wanton flume
bleak garnet
#

You should pick some area you are interested in and explore it. Like you just said brick by brick you accumulate knowledge in a domain you work in.
For example my career is in the embedded space so I have no clue what the web dev scene really looks like

wanton flume
bleak garnet
#

at a company, I don't do too much in my free time

ghostty is probably my most active freetime project actually

wanton flume
bleak garnet
bleak garnet
wheat marlin
# wanton flume I thought to write Vim like txt editor in zig.

I do want to caution you from thinking you will achieve something close to vim, it has been actively worked on for decades.

you can certainly get the fundamentals down, infact, i would say that part is rather easy, compared to fleshing it out into something usable for serious programming.

wanton flume
prisma whale
#

One feature I would enjoy to see in text editors is the ability to scroll past the start.
At least most modern text editors allows one to scroll past the end until the last row is at the top of the document view. It would be wonderful to scroll the other way until the document start is at the bottom of the document view.

wanton flume
wheat marlin
#

"isnt that it" is quite the understatement, I think you are underestimating how hard some of those are. That being said they certainly have niave solutions that are a lot easier to implement that a fast efficient responsive implementation.

wanton flume
wheat marlin
#

some of that is certainly easy to do, but it depends on less easy things.
for example cursor movement itself is quite easy, but it has a lot of edgecases you will encounter.
rendering it in the correct location is semi dependant on how you store the data for a file too. which gets complicated if you want large files to still be responsive when editing them.
and it gets really complicated if you want to add undo/redo.

wanton flume
wanton flume
wheat marlin
#

yes but you also have to make the file contents match with the scroll, which depends on how you store it, which depends on the things i mentioned.

you dont have to make it responsive for large files, nor implement undo/redo. its just an example of what is more complicated than you might have thought at first, its totally possible you are more aware than i think, in which case ignore me :)

wheat marlin
#

undo/redo interact heavily with how you store the file contents, on their own they are fairly easy, but together they become a big headache. that ofc depends on your knowledge of the topic and experience with similar data structures that known solutions use.

#

but you can also just forgoe that feature, in the name of working on other features you can add with less pain :)