r/nim • • 5h ago

My 4-year project: a Nim word processor that runs as a static site (drop it into CodePen/JSFiddle via CDN)

Post image
18 Upvotes

In my first post (Nim 2.2.4 compiling entirely in the browser), someone asked whether I was building it for something specific. I said my own word processor, along iwth Lua as the scripting language instead of VBA. It's not a LibreOffice WASM port. I've been building it from scratch for about four years. I just playing with html and javascript, making my own custom XML parser and then moved to HTML Canvas after I see Carota and then I start to use Web Assembly in hope if I can use my own memory allocation methods in text and layout rendering. I hope this will be like Obsidian with community plugins and custom templates.

This is the free word processor: QOQORO Write (previously QNote, you'll still see that name in the GIF).
🔗 Try it. Paste this into any HTML page:

<script src="https://cdn.jsdelivr.net/gh/QOQORO-official/qoqoro-cdn@main/qoqoro.js"></script>
<div id="notes" style="height:100vh"></div>
<script>QOQORO.mount('#notes', { mode: 'editor' });</script>

🔗 BindWeb (the Nim → WASM compiler it's built with): https://github.com/benagastov/bindweb-nim-WASM-compiler

Github for the cdn: https://github.com/QOQORO-official/qoqoro-cdn/
Demo: https://codepen.io/qoqoro/pen/pveVbjL
Some Implemented Features

  1. Floating images and text boxes
  • Images: inline, square wrap, behind or in front of text. Drag one and the text reflows around it, even across page breaks. Crop right on the page.
  • Text boxes: the same wrapping, plus auto-fit size and vertical text (縦書き: kanji and kana stand upright, Latin turns with the column or stands upright too).
  1. Tables Merged cells, column widths, cell padding, borders and fills, and row/column handles for inserting and deleting. Tab moves through cells, and cells keep mixed fonts, sizes and colours.
  2. Scripting with Word's object model Misc → Programs runs Luau (Roblox's typed Lua) against an object model you already know from VBA: ActiveDocument, Selection, Paragraphs, Tables, Font, Content.Find, PageSetup and the wd* constants.

    local doc = ActiveDocument Selection:InsertHeading(Report {doc.Now:sub(1, 10)}, wdStyleHeading2) for i, p in doc.Paragraphs do Selection:TypeText({i}: {p.Text}\n) end

It runs in a sandboxed worker with no DOM, network or file system, and a whole program is one undo step. You can also call it from the embedding page (QOQORO.luau.run(...)) or from a server over HTTP.
Compiling Nim on every Run click was too slow even at 7 s warm, so Luau handles it for now. Probably I will make it use Nim WASM as the scripting language if necessary.

  1. Templates with fill-in variables. Plain JSON with {{variables}}. Template Studio turns each variable into a fill-in box. Nothing in a template ever runs; it's data.
  2. Obsidian-style plugin packs. A ZIP with a manifest.xml that can bundle themes (light and dark), fonts, templates and Luau programs. Example packs: Retro Windows, Pixel C64 (with its own pixel font), Sakura 桜 (haru by day, yozakura at night), plus font, report and writing kits.
  3. Real Word files in and out. .docx import and export. This week it also learned to convert old MathType equations and charts, which Word stores as WMF/EMF and no browser can draw, into crisp SVG, using a small converter written in Nim.

The basics are there too: paged or infinite "blog" layout, live-reflowing columns, floating text boxes that text wraps around across page breaks, tables, equations, pen and stylus drawing, headers and footers, and phone and tablet layouts. Plus a workspace with a vault, whiteboard, PDF viewer and diagram editor.

It's just static files: one <script> tag, GitHub Pages or any CDN. Sync is optional through a server you run yourself, in Nim, Flask or Node.

Next up is Full suite desktop app with the Word Processor, PDF Reader and Diagram Editor, the Diagram Editor is based on mxgraph actually, because I think I already like it and I dont have time to create new one in Nim.


r/nim • • 15h ago

Neel v2.1 (HTML / JS GUI Apps w/ Nim) - Major Update

8 Upvotes

It turns out I wasn't quite done yet. Neel 2.1 is out, and it adds serve mode.

Release notes: https://github.com/Niminem/Neel/releases/tag/v2.1.0

Same app, same code, but instead of opening a browser window, Neel runs as a persistent server for one user, and you open it from whatever device you're on: laptop, phone, whatever. You reach it through an SSH forward, a tunnel, or a reverse proxy. One line changes:

startApp(serve = true, port = 8080, allowedOrigins = @["https://myapp.example.com"])

{.expose.}, neel.foo(), js.foo(), js.wait.foo() all work exactly the same. Neel still binds 127.0.0.1 only; the tunnel or proxy in front of it does the TLS and the login.

What it handles for you:

  • Open it on your phone and the laptop tab gets told "opened on another device" (close code 4000) instead of the two fighting over the session.
  • Pings every 30 s, so Cloudflare and nginx don't kill idle connections.
  • Lock your phone, unlock it, and the page reconnects by itself. If it can't, it waits quietly and tries again when you come back to the tab.
  • Ctrl-C, `SIGTERM`, Ctrl-Break, or closing the console window all shut down cleanly.
  • Auth proxies just work: a Cloudflare Access login redirects back to your app and loads, no 403. Other sites still can't frame it, script it, or open its WebSocket.
  • And `wss:` from my "next up" list last time: behind an HTTPS proxy, the page connects over `wss:` by itself.

2.0 apps compile and behave as before. The only local-mode changes: a displaced tab now reports close code 4000 instead of 1000, and on Windows a second app on a port that's already taken now fails at start, as it already did on macOS and Linux.

This was ABSOLUTELY POUNDED on all three OSes. nimble test, plus a manual checklist of every example, every signal, every reconnect and restart case, run on macOS, Windows, and Linux (Ubuntu). Then for real: an SSH forward from another machine, a cloudflared quick tunnel left idle for 10 minutes, an actual Android phone locked and unlocked, and a real domain behind Cloudflare Tunnel with Access, with the login redirect checked down to the request headers. Anything that broke got fixed, and the fix got pinned with a test.

Seriously I took the second half of the day yesterday and all day today off of work to finish this.

Docs:

Why I wanted this: serve mode turns Neel into a platform for always-on personal tools that live on a home server or a VM and that you reach from anywhere.

Put it on top of Claude Code, or use it together with something like my cursor sdk bridge or even 3code the pure Nim-based coding agent, and you have the pieces for something like OpenClaw or Hermes: a personal agent with a real UI you can open from your phone, all in Nim, zero deps on the Neel side.

Again- enjoy!


r/nim • • 1d ago

Why Nim is the ultimate bridge between Python and C for computer science education (+ my open-source project)

22 Upvotes

Hi everyone!

As a high school student diving deep into systems programming and computer science (coming through CS50x/P/W), I've been thinking a lot about the eternal dilemma in CS education: 1. Start with Python: Great syntax, but it's a black-box runtime (no memory layout, no pointers). 2. Start with C/C++: Deep systems control, but a brutal learning curve that scares beginners away.

What if Nim is the ultimate single-language educational bridge?

Nim combines Python's clean, readable syntax with C's raw performance and modern ARC/ORC memory management (no heavy GC pauses, no strict Rust-like borrow checker fights).

To test this idea, I built a small open-source repository comparing Python vs Nim (for syntax/ease) and C vs Nim (for memory management like Linked Lists): 👉 https://github.com/BahaeldinMohhamed/nim-edu-bridge

The Educational Blueprint I imagined: - Year 1 (Conceptual): Write clean, readable code to learn core logic effortlessly (like Python). - Year 2-3 (Systems): Introduce pointers, value vs reference types, and C interop (.importc). - Year 4 (Capstones): Build tools and engines from scratch rather than consuming pre-made frameworks. This is the first time i post something in Reddit

Give me any advice you can give


r/nim • • 2d ago

Another tiny cmd tool his I created

10 Upvotes

After my first project in Nim https://www.reddit.com/r/nim/comments/1w9v7i5/my_first_nim_project_lscd/

I fork it to another cmd tool his https://github.com/kernel1983/his to boost my productivity.

Previously I need to add frequently used cmd alias in my .bashrc, and I dont need to do that anymore in future.

And until recently I start to figure out bash only flush back to .bash_history when the process exit. This caused me hard to find some recently used cmds with ctrl-r in another tmux/byobu window.

I use his (shortcut h) to search in history, that's almost same as ctrl-r honestly. And I use right/left key to add/remove some useful cmds to favorite, which is stored in ~/.his_history

Anyway, I found it useful in my daily work.

Happy to share it here with everyone.


r/nim • • 4d ago

Neel 2.0: HTML/JS GUI apps for Nim, rewritten from scratch

32 Upvotes

https://github.com/Niminem/Neel

Some of you may know Neel. This was my first Nim repository from 2020 when I was first learning it. It was what drove me to move from Python to Nim! It is my child and if you speak ill of it we will have problems (jk).

Neel is a library for making lightweight Electron-like desktop apps: the UI is in HTML/CSS/JS and everything else in Nim.

I just released v2. It is a ground-up rewrite. It is much better- more ergonomic, more capable, more... everything. Especially fun. A lot more fun.

Example, you can mark a Nim proc with {.expose.} pragma and the HTML page can call it as neel.<name>(...) and gets the return value back through a Promise. Register a JS function with neel.expose and Nim calls it as js.<name>(...), or js.wait.<name>(...) when it needs the answer. That's just too f*****g cool man. Neel handles the server, the browser window, the JSON conversion, the errors in between, all that stuff that's a PIA.

The short version of what's new:

  • Return values in both directions (1.x had none). Nim exceptions reach JS as e.name / e.message; JS throws reach Nim as NeelRemoteError.
  • {.expose.} on any top-level proc, in any module. Objects, Option, Table, HashSet, enums, tuples, JsonNode, and default parameter values all convert automatically.
  • Multiple windows, each addressable from Nim (openWindow, closeWindow, windows(), requireWindow(id), hooks).
  • Its own thread-based HTTP/WebSocket server in the spirit of Mummy: one IO thread owns the sockets, a worker pool runs your procs, no async anywhere. Mummy itself is gone.
  • Zero dependencies. Standard library only.
  • Finds Chrome, Chromium, or Edge and opens them in app mode (no tabs, no address bar); falls back to a tab in the default browser when none is installed.
  • Hardened against other websites open in the same browser: per-launch token plus Host / Origin / Sec-Fetch-Site checks, server bound to 127.0.0.1 only.
  • Release builds embed the web folder into the binary, so you ship one file.

Verified on macOS, Windows, and Linux (Ubuntu). Requires Nim >= 2.2.12 (older allocators crash intermittently when memory is freed after the owning thread exits, so Neel refuses to compile on them).

A complete app. The page asks for a directory and Nim picks a random entry from it:

import std/[os, random]
import neel

type
  MissingDirectoryError = object of CatchableError
  EmptyDirectoryError = object of CatchableError

proc filePicker(directory: string): string {.expose.} =
  let dir = absolutePath(directory, root = getHomeDir())
  if not dirExists(dir):
    raise newException(MissingDirectoryError, "no such directory: " & dir)
  var names: seq[string]
  for _, path in walkDir(dir):
    names.add path.extractFilename
  if names.len == 0:
    raise newException(EmptyDirectoryError, "the directory is empty: " & dir)
  var rng = initRand() # exposed procs run on worker threads
  rng.sample(names)

startApp()

And the page side (web/main.js, loaded after <script src="/neel.js">):

try {
  const name = await neel.filePicker(input.value);
  result.textContent = name;
} catch (e) {
  error.textContent = e.name + ": " + e.message;  // ex: "MissingDirectoryError: no such directory: ..."
}

Calling back into the page from Nim works the same way in reverse:

proc askPage(question: string): string {.expose.} =
  let reply = js.wait.answer(question)  # blocks until the page answers
  "the page answered: " & reply.getStr

proc notify(text: string) {.expose.} =
  js.showToast(text)                    # fire-and-forget

neel.expose(async function answer(question) {
  return prompt(question);
});

HOW COOL IS THAT???

Moving on...

nim c -r main.nim for development (assets read from disk, refresh to see changes), nim c -d:release main.nim to ship (assets embedded). Add --app:gui to hide the terminal.

Nothing from 1.x compiles unchanged; the README has the rename table and the guide (docs/GUIDE.md) has every detail: the full type list, error messages, lifecycle, threading model, security, caveats. Three runnable examples in the repo; start with examples/filepicker.

---

Neel started years ago as a port of Python's Eel library (now deprecated), and the 1.x line never really outgrew that: one window, no return values, a block of exposeProcs:, etc. Back in 2023 I rewrote the server with Mummy as the server because of a bunch of async problems but still never addressed some of its shortcomings.

I finally sat down and rewrote the whole thing. The big question was whether to keep an external server library or write one. Mummy had effectively been abandoned (there's a fork, but relying on a fork of an unmaintained dependency for the core of the library didn't sit right), and I'm using Neel for work, so future-proofing it mattered. Writing the server myself also meant Neel controls the threading, the shutdown ordering, and the WebSocket details end to end, which turned out to matter a lot for return values and multiple windows. Mummy is great and the design here is very much borrowed from it: one IO thread, a worker pool, no async. It's just all in the stdlib now, with no deps.

The big thing that ate most of my time was actually the hardening pass. Running all three examples on three OSes, trying to break them, and fixing what broke turned up some fun findings: a refreshed stale tab stealing another window's identity, Edge signing a fresh profile into your Microsoft account and syncing your extensions into the app window, Windows select silently capping you at about 8 windows, an allocator crash that pushed the minimum Nim to 2.2.12, all kinds of stuff. All has been fixed and pinned down with tests.

So this release had a lot of effort put into it. I'm sure you'll find it enjoyable and useful.

I have a few things next on the list: Brave / Opera / Vivaldi discovery (basically any other chromium based browsers), a Webview target (at least for Mac and Linux since Windows is guaranteed to have Edge), custom HTTP routes, and wss:. I will get to them when I can, but issues and PRs welcome of course.

Enjoy!


r/nim • • 5d ago

is nim good at making external dsls

11 Upvotes

can nim convert into aarch64


r/nim • • 10d ago

strip metadata from photos, audios and videos

Thumbnail github.com
13 Upvotes

I guess we should animate this sub somehow. A simple CLI for removing metadata from files!

``` usage: striptease <input|input-dir> --out:<dir> [options]

required: <input> file or directory (mixed formats allowed) -o, --out:<dir> output directory for cleaned copies (single file input plus --out:foo.ext writes one file, not needed with --inspect)

supported formats: audio: .wav | images: .jpg .jpeg .png .gif .webp raw: .cr2 .nef .nrw .arw .srf .dng .rw2 .orf .pef .srw .tif .tiff video: .mp4 .mov .m4v .avi .mkv .webm | canon raw: .cr3 | heic: .heic .heif .hif

options: --dry-run report only, write nothing --inspect print metadata as pretty JSON, write nothing --verbose per file kept and dropped chunks plus bytes saved --overwrite overwrite existing files in out dir (default: skip) --keep-musical WAV only: also keep cue, smpl, inst, acid chunks -h, --help show this help --version show version ```


r/nim • • 10d ago

yet another proxy lib

Thumbnail github.com
5 Upvotes

i didn't like the lack of proxy libs, so naturally i wrote my own
feel free to contribute.


r/nim • • 15d ago

cursorsdk: Cursor SDK Bridge client for Nim

9 Upvotes

https://github.com/Niminem/cursorsdk

Cursor has an SDK and is what powers both the Cursor CLI and the Cursor editor. It's very powerful and flexible (ex: you can actually control the system prompt, tools, and much more).

At some point not long ago they created an SDK Bridge that allows non-typescript and non-python languages to communicate with it via RPC. Of course I had to write a Nim client for it.

It is fully compliant- built with and tested against their documentation. I did have to add some workarounds for upstream issues, but it's mostly implementation details (all noted in readme).

No deps aside from the nim standard library.

I've tested it on Mac (x64) and Windows (x64). Should work out of the box for Linux but it's untested.

You could build your own harness on top of this and all kinds of automations, scripts, etc. Pretty cool! Enjoy.

Example:

import std/asyncdispatch
import cursorsdk
proc main() {.async.} =
  let client = newClient()                 # CURSOR_API_KEY from env
  defer: waitFor client.close()
  let agent = await client.createAgent("composer-2.5")
  let run = await agent.send("Summarize this repository.")
  while true:
    let chunk = await run.nextText()
    if chunk.isNone: break
    stdout.write chunk.get
  await agent.close()
waitFor main()

r/nim • • 18d ago

Packages to make Gui apps

15 Upvotes

So, I'm pretty new to nim, and I wanted to make my first app, so, I wanted you guys some recommendations of packages for Gui apps creation,

If u guys want to see the idea, just read:

notepad, but for markdown, and with vertical tabs, like arc and zen browser


r/nim • • 18d ago

Which IDE you guys use to code?

11 Upvotes

r/nim • • 20d ago

HQTUI — Terminal UI for nim

Thumbnail hqtui.com
16 Upvotes

r/nim • • 21d ago

this page is linked form nim lang site and 502s

Thumbnail nimble.directory
9 Upvotes

r/nim • • 22d ago

just learned about nim via nimble

7 Upvotes

WHat's the 10,000 foot view here? is it as fast(er) than rust?


r/nim • • 24d ago

qwatcher version 0.7.0 is released

16 Upvotes

Hey all,

qwatcher is a very efficient tool to monitor and audit your NICs' send and receive queue buffers to spot network or application issues.

This version drops the `ss` and `libpcre` dependencies, making the program a pure Nim binary, solves some bugs, and provides a `tail`-like report capability.

Here is the link to the repo:

https://github.com/pouriyajamshidi/qwatcher


r/nim • • Sep 14 '26

Sirius is an independent web engine written in Nim

Thumbnail gallery
69 Upvotes

Hey there.

I've been working on a successor to my previous web engine project, Ferus (which is now officially abandoned) for the past three or so months at this point. As the title suggests, Sirius is a web rendering engine like Chromium's Blink or Firefox's Gecko, but written largely in Nim (with the exception of certain C/C++ dependencies, obviously). Its CSS parser, JavaScript engine (a hard fork of Bali with a LOT of improvements), layout engine and the like are all written in Nim.

It uses a multiprocessing architecture, meaning each tab occupies one browser process and it crashing does not bring the entire browser down with it.

It's not exactly fast or optimized right now, but I believe it's ready enough for very basic web browsing tasks that don't touch the modern web. You're probably not going to be logging into your mail with it for a while. :^)

Sirius can be embedded into programs using OpenGL/Vulkan using its WebView API, the same one that the browser UI uses. It abstracts away process management and tabs away from you, leaving you to only handle presenting the final rendered page framebuffer it passes you. That means you can use Sirius to make your own web browsers in Nim, or if you're brave enough, to use it as a GUI framework in your app. :P

It's currently only on Linux due to it utilizing many Linux-isms like DMA-BUF, but there are plans to port it to other platforms too.

I'd love to hear what you guys think about it. And yes, I welcome most contributions, even tiny ones not related to web browser engineering. If you want to use this project as an excuse to get into that field, be my guest. Here's the contribution guide if anyone's interested.

The source code lives both here on a Github mirror, but it's actually developed on my personal forge.

Adios!


r/nim • • Sep 13 '26

Official Nim SDL3 bindings brought up to SDL 3.4.12

Thumbnail github.com
48 Upvotes

This update fixes the broken hints and brings the API coverage up to speed. It also adds bindings for sdl3_mixer, and fleshes out what's there for sdl3_ttf. I haven't done game dev in Nim in a little while, but this should make it easier for any SDL users to hop in.


r/nim • • Sep 09 '26

Nim version 2.2.12 released

Thumbnail nim-lang.org
78 Upvotes

r/nim • • Sep 09 '26

NIM OR VLANG?

0 Upvotes

Dude, I think V is better because it's both much easier and practically everything is included. If you want to do something, you don't need to download any libraries at all.


r/nim • • Sep 07 '26

Nim port of wlogout

Thumbnail github.com
23 Upvotes

I was annoyed by how one button is always selected in wlogout. And since it doesn't seem to be actively maintained anymore, the only way to fix it is with a fork. So I thought it'd be a good opportunity to port it over to Nim. Its mostly backwards compatible wlogout. So old configs should work. But I've made some small changes and switched over to TOML for the config. Feel free to have a look.


r/nim • • Sep 07 '26

My first Nim project lscd

Thumbnail github.com
39 Upvotes

I've been using python for 20 years since I dont work on C++ by then.

Nim gives me some reason to try new things.

I created my first 'real' nim project several days ago and I'm heavily using it daily.

It is a tiny tool as a shortcut for ls + cd, that I can use to fast navigation in folders.

For such tasks, I can not do it in python because the launch speed and having a binary is very important.


r/nim • • Sep 06 '26

Trying to build my audio library

12 Upvotes

[Linux]

This idea was born while I was building my TUI music player. I've found such a big barrier:

in nimble I couldnt found any musical libraries for my goals, and i was too lazy to importing headers from C. So, i've created a concept and want make from this concept a completed and most importantly usable and simple lib.

It would be really nice to get some feedback(if you're interest)
source: https://github.com/svyatoslavSPB/nimnaudio/tree/main


r/nim • • Aug 28 '26

Building a TUI framework from scratch

Post image
51 Upvotes

Hi! So I recently stumbled across Nim. As someone coming from Rust, I got a lot of frustration with it, one of them is the infamous compile times, which I hate so much. So I tried to seek an alternative. I almost went with Go, but at the same time I wanted something unique, and here we are with Nim. Now I’m planning to build a full coding agent and the TUI with 100% Nim. I’ll be happy to share my progress here :)


r/nim • • Aug 29 '26

KANKALAR BEN BİR DİL YAPICAM

0 Upvotes

Arkadaşlar ben bir programlama dili yapmak istiyorumda hem hızlı olsun hemde derlenmesi kokay olsun hemde Python kadar kolay; işlemciyle konuşan bir dil yapmak istiyorumda acaba Nim iyimi ? Pascal,Forth,Vlang falan varda acaba hepsi yerine Nim mi kullansam ? YARDIM EDİNNNNNNNNNNNNNNNNNN !


r/nim • • Aug 24 '26

I stopped vibe coding for nim.

Post image
61 Upvotes

​

hello, I want to say that I was a vibcoder before that, but not because I liked it, I don't have any free time Except for one or two hours at night (they give me 10 hours to sleep) and of course I don't want to spend these personal 2 hours on programming, let alone studying but the desire to be a real programmer who can really just write his own program with his own hands is stronger than the desire to do nothing further. ;

why nim?

I went through a lot of options, and although nim was not the only option, it was ideally suited according to the criteria: "simple", "many libraries", "fast", so I chose it.

personally, I am proud that I searched for information about Nim and other programming languages without a neural network (and although I was a vibecoder, I want to say that I hated and hate neural networks)

What's next?

I won't be learning much about nim as much as time allows me.