from Hacker News

Pragtical: Practical and pragmatic code editor

by rd07 on 8/20/24, 7:15 AM with 106 comments

  • by bunderbunder on 8/20/24, 2:10 PM

    Not criticism, just thinking out loud:

    This editor claims to be lightweight, citing that it uses 30MB of RAM. But I assume that's without any extensions loaded.

    Back in the day, though, one joke about Emacs was that it's an acronym for Eight Megabytes All Continuously Swapping. This was meant to highlight Emacs's reputation for bloat. Right now when I run Emacs it's using a lot more than 30, let alone eight. I'm pretty sure most of that is all the modes I have installed for every language I might ever use, regardless of whether I'm actually using it right now.

    About 15 years back Visual Studio had a reputation for bloat, but my experience was that it was actually quite lightweight and snappy, especially compared to Eclipse and IntelliJ. Until you install ReSharper, which transformed it into 50 tons of molasses.

    At work, Visual Studio Code currently consumes about 1GB of RAM and takes 5+ minutes to start up. On my personal computer, a 2013 MacBook, it uses more like 50MB and starts darn near instantaneously. But they're very different beasts; on my MacBook I've got it configured to only load the plugins I need for each project. At work we've got a whole dang Devcontainer that includes configuration to load I-don't-know-how-many extensions, basically anything anyone on the team has ever wanted. The devcontainer extension makes you put the list of extensions to load into a file that needs to be checked into source control. So the only way for someone to get this tool they want is to make everyone else get it, too. All to sling a relatively modest volume of Python code.

    And of course if I try to opt out of all of that I make my life even harder. Trying to get by without that pile of crap is just spitting in the wind. Run-time requirements aren't documented; they're shoved into an undocumented and ever-growing list of Bash commands in the Dockerfile. Coding standards aren't documented or managed with something straightforward like Git hooks; they're enforced through a plugin and its configuration.

    I do remember when vscode was lightweight. It happened to be a time when not many plugins were available. That put a hard limit on just how much bloat you could accomplish. But, of course, as soon as it got popular people started creating plugins for darn near everything.

    Perhaps the problem isn't the editors. Perhaps it's us.

  • by geenat on 8/20/24, 8:22 AM

    As an extension writer...

    Writing extensions in Lua is huge. (Same as OBS) Looks very simple and productive.

    It's one of the main reasons I've stuck to Sublime... extending with Python is very easy and works everywhere.

    Even if both Zed and VSCode are strong in other areas.. Rust extensions makes me cringe (a build toolchain? ugh..) VSCode's inconsistent undocumented Javascript API is a pain in the butt (paste & pray driven development).

    Will be keeping an eye on this.

  • by _benj on 8/20/24, 9:30 AM

    Just the fact that they did such an amazing job with their documentation is as huge win for me!

    I really liked Lite XL but back when I looked at it it was a challenge to understand it’s API and functionality.

    Looking forward to give this a spin!

  • by fusslo on 8/20/24, 1:46 PM

    Tangential: is there an IDE out there that supports different color schemes for each window it has open? does Pragtical? I didn't see it in the docs

    I used to like having different projects open in different windows and easily differentiate between them with their color schemes. Kinda like setting a terminal to open with a random color profile

    It seems like vscode and sublime want to change the scheme across all the windows.

  • by mosburger on 8/20/24, 12:29 PM

    Is anyone else getting a "“Pragtical.app” is damaged and can’t be opened. You should move it to the Trash" error when attempting to run the arm64 build on macOS? Really wanted to try it out!

    I suppose it could just be some security crap Corp IT installed on my laptop preventing it from installing.

    It looks like it's only taking up 7.9MB in my Applications folder so it must be corrupt or something.

  • by vouaobrasil on 8/20/24, 7:25 AM

    Looks a lot like LiteXL. Is it based off it? What makes it different?
  • by atlintots on 8/20/24, 10:30 AM

    Why fork Lite XL instead of contributing? Just out of curiosity, since I'm not familiar with either project and don't know what their respective philosophies are.
  • by mdaniel on 8/20/24, 5:14 PM

    https://github.com/pragtical/plugins/commit/54096a6461f5c034... makes me long for The One Grammar To Rule Them ™

    I thought for a while that TextMate bundles[1] were that, especially since JetBrains[2], Linguist[3] and VSCode[4] honor them. However, in the spirit of "the good thing about standards ..." highlight.js does[5] almost the same thing that Pragtical does which makes me feel even worse

    I had high hopes for Tree-Sitter since it seems to have really won mindshare, but the idea of having an executable grammar spec[6] is ... well, no wonder it hasn't caught on outside of that specific ecosystem

    1: https://github.com/rspec/rspec.tmbundle/blob/1.1.12/Syntaxes...

    2: https://github.com/JetBrains/intellij-community/blob/idea/24...

    3: https://github.com/github-linguist/linguist/blob/v7.30.0/lib...

    4: https://github.com/microsoft/vscode-textmate

    5: https://github.com/highlightjs/highlight.js/blob/11.10.0/src...

    6: https://github.com/tree-sitter/tree-sitter/blob/v0.22.6/test...

  • by torginus on 8/20/24, 8:48 AM

    The UI gives me a Godot-y vibe. Is there some relation?
  • by teo_zero on 8/20/24, 11:40 PM

    Micro-review after having used it for half a day on Windows.

    It seems really lightweight: the UI is spartan but snappy, loading a file is instantaneous, etc. Downloading and installing a plugin is as easy as dropping a Lua file into a directory. And even after installing several plugins, the speed doesn't seem affected.

    On the other hand, it comes with hardly any feature out of the box, and everything must be covered by plugins. The plugins are really "atomic". For example, one is to auto-indent, another one to auto-format a block; one is to highlight the matching bracket a second one to jump to the matching bracket, and a third one to automatically insert the closing bracket, while yet another one draws rulers to visualize the block between matching brackets. Do you want to set markers and jump between then? another plugin. Build from within the editor? another plugin. And so on...

    The plugin "store" looks good, but accessing it from inside the editor is a poor experience: sometimes it just hungs and you have to restart the editor. Additionally the fact that plugins, themes and fonts are all mixed up doesn't make it easy to find what you're looking for.

    Final judgement: if I need to select and install 10 to 15 plugins just to make it on par with a stock Vim, I'll stay with the latter.

  • by kerkeslager on 8/20/24, 3:09 PM

    Anyone have any experience building GUIs in SDL?

    I have been using Flet (basically multilingual binding for Flutter) to build GUIs the last year or so, and in general the experience has been very good.

    However, I've recently started work on a project that has need for a large number of controls--on the order of 2000 controls visible at one time--and I'm running into Flet's limitations. All the Flet controls have animations, which creates a good default experience when there's a few of them, but when you're using 2000 of them, simply passing your mouse over an area with a bunch of controls causes a cascade of small animations and the renderer explodes. Impressively, it usually doesn't seem to cause any performance lag, but it seems like the way they avoid lag is just by dropping the animations half-rendered which causes the window to flash all sorts of broken half-rendered gobbledygook to the screen. My approach has been to turn off animations as much as possible, but there are enough controls visible at any one time that even just rendering the without animations is running into issues.

    I'll probably just deal with it for my first version--the core functionality is about number crunching and the user base is used to using much worse UIs--but I'm looking at lower-level tooling that can still remain cross-platform. In this post I'm seeing that Pragtical is advertising that they're written with SDL and I'm seeing some similarities between a code editor and what I'm doing, so it seems like that might be the solution to my problem.

  • by truckerbill on 8/20/24, 8:44 AM

    Is it possible to do custom drawing modes for diagrams and viewers?
  • by swah on 8/20/24, 9:45 AM

    Downloaded both Lite XL and Pragtical and have to say that Lite XL looked ok on open, while Pragtical looked super tiny and all the UI was out of alignment.
  • by system7rocks on 8/21/24, 4:59 AM

    Just FYI, the thing crashed on me in inventive ways.

    First, the ARM version, when I tried to launch it, had MacOS say it was damaged. Only option was to move it to the trash.

    The Universal option did work, but when I tried to open a standard .c file, it crashes. It is fast though and fairly slick looking. But needs work.

  • by brisket_bronson on 8/20/24, 12:52 PM

    I just tried it and culdn't get past the first screen. The "installation" failed on mac and had to find a workaround just to use the editor. All the fonts look wrong, too small and misconfigured. Maybe the project needs more time to mature, in the meanwhile, I'll stick to vim.
  • by mnmalst on 8/20/24, 2:07 PM

    Doesn't pick up my (non ttf) Terminus font and there is no obvious way to set the font manually.
  • by hans_castorp on 8/20/24, 7:31 AM

    The user interface font is way too small and nearly impossible to read on a 4K monitor (on Windows)
  • by hollerith on 8/20/24, 7:32 PM

    Like other apps that use SDL, this (Pragtical) is blurry on Gnome with the scale-monitor-framebuffer experimental feature enabled and scaling set to some value other than 1.00.
  • by artemonster on 8/20/24, 10:51 AM

    Do I understand correctly that its a software renderer? They manually blit a buffer from glyphs and use SDL to show it, akin to immediate mode?
  • by stephc_int13 on 8/20/24, 3:17 PM

    Not sure if this is mentioned somewhere, but it looks like a fork of the lite editor, also built on top of SDL and Lua.
  • by prmoustache on 8/20/24, 10:43 AM

    Does it have a multiple modes support and vim-like keybindings either vanilla or through plugins?
  • by emrah on 8/20/24, 5:58 PM

    > light weight

    Honestly that's not an issue, I would personally not base my judgment on memory usage, unless it is a memory hog.

    I know others do but for reasons that go beyond practical. For those that have things to get done, I suspect they think like I do.

  • by swah on 8/20/24, 9:30 AM

    No LLM plugins yet?
  • by max_ on 8/20/24, 7:08 PM

    3.5 MB is great news, I am happy it's not another electron editor.

    I will be trying this!

  • by BigParm on 8/20/24, 9:28 AM

    How does it occupy 30MB ram but 5MB disk space does it grow
  • by k__ on 8/20/24, 9:15 AM

    "runs locally on your machine as a CLI application"

    Hrm, I was hoping it would run all in the browser.

    Cool idea nevertheless!

  • by cynicalpeace on 8/20/24, 2:09 PM

    Any IDE that isn't "AI first" is going to have a hard time from here on out. Cursor is beginning to eat the world much like VSCode did.

    I'm sure there are some here on HN that will say "nah, I prefer the old fashioned way" but you will be decidedly in the minority very fast.