Live data from Hacker News

Build Your Own Text Editor

viewsourcecode.org

1–10 of 164 posts

Re: Build Your Own Text Editor

#4
Reference implementations of medium sized applications are incredibly useful for leveling up as a programmer. While there are many large successful open source applications, many are overwhelming to read and learn from.

Having something that outlines the key features and components and which ignores the important but complicated edge cases assists in keeping the attention focused.

Now if there are annotation within the source code, that would be truely incredible.

Re: Build Your Own Text Editor

#7
post #2

Neat! I have been trying to, in Nim, but I've had so little experience working with raw terminals and the IOCTL handles, I've been struggling! https://github.com/girvo/te This looks like a great tutorial to work through with it :)

Quickly looked at your source without the slightest knowledge of Nim language. It was certainly Python-like in ease of reading like some here told me. Nice, clean look to it vs the C stuff. Exception is types.nim file that just looks syntactically rougher than others with the asterisks. It looks like class or struct definitions but I'm curious if the asterisk has an effect like it does in C or what's it do?

Re: Build Your Own Text Editor

#8
post #2

Neat! I have been trying to, in Nim, but I've had so little experience working with raw terminals and the IOCTL handles, I've been struggling! https://github.com/girvo/te This looks like a great tutorial to work through with it :)

Quickly looked at your source without the slightest knowledge of Nim language. It was certainly Python-like in ease of reading like some here told me. Nice, clean look to it vs the C stuff. Exception is types.nim file that just looks syntactically rougher than others with the asterisks. It looks like class or struct definitions but I'm curious if the asterisk has an effect like it does in C or what's it do?

The asterisks are what define a symbol as "exported" from a module -- every symbol is private to the module scope by default, but able to be exported by applying the asterisks to it; types.nim is funky because I was exploring a slightly different file/module structure (and having a singular place for top-level shared types that most other modules import is quite useful at times, and gets around circular dependencies), except it does end up looking slightly odd!

Re: Build Your Own Text Editor

#9
post #8

Earlier quoted context omitted.

Quickly looked at your source without the slightest knowledge of Nim language. It was certainly Python-like in ease of reading like some here told me. Nice, clean look to it vs the C stuff. Exception is types.nim file that just looks syntactically rougher than others with the asterisks. It looks like class or struct definitions but I'm curious if the asterisk has an effect like it does in C or what's it do?

The asterisks are what define a symbol as "exported" from a module -- every symbol is private to the module scope by default, but able to be exported by applying the asterisks to it; types.nim is funky because I was exploring a slightly different file/module structure (and having a singular place for top-level shared types that most other modules import is quite useful at times, and gets around circular dependencies)…

I appreciate it. So, it looks weird because it's an experiment with something non-standard? Makes sense. Things stay clean overall.

Re: Build Your Own Text Editor

#10

Reference implementations of medium sized applications are incredibly useful for leveling up as a programmer. While there are many large successful open source applications, many are overwhelming to read and learn from. Having something that outlines the key features and components and which ignores the important but complicated edge cases assists in keeping the attention focused. Now if there are annotation within t…

Do you have anything similar that you would recommend?
Post reply on HN