#!/usr/bin/env fish | |
function find-match-in-parent-dir -a "find_match" | |
set -l path "$PWD" | |
while [ '/' != "$path" ] | |
find "$path" -maxdepth 1 -mindepth 1 -name "$find_match" | |
set path (readlink -f "$path/..") | |
end | |
end |
import std/[os, strformat] | |
import Nim / compiler / | |
[ idents, options, modulegraphs, passes, lineinfos, sem, pathutils, ast, | |
astalgo, modules, condsyms, passaux | |
] | |
let file = "/tmp/ee.nim" | |
file.writeFile(""" | |
proc test*(arg: int) = echo arg |
Technically this is just function call using method call syntax - ×
is treated as regular identifier (like someFunction
) and it is perfectly legal to call obj .someFunction arg
. So a .× b
is not really different in that regard.
proc ×(a, b: set[char]): seq[(char, char)] =
for aIt in a:
for bIt in b:
import asynchttpserver, asyncdispatch, os | |
proc handler(req: Request) {.async.} = | |
echo "request for path ", req.url.path | |
let cwd = getCurrentDir() | |
let file = cwd / req.url.path | |
if fileExists(file): | |
await req.respond(Http200, file.readFile()) | |
else: |
Base C++ class cppbase.cpp
#pragma once
#include <stdio.h>
struct CppBase {
virtual void baseMethod(int arg) {
printf("arg from nim - %d -\n", arg);
Starting from this version you can run nim fusion
to install or update the fusion
package - an extension to the nim stdlib with some additional modules.
Currently, the following modules are present:
fusion/smartptrs
- C++-like unique/shared pointersfusion/btreetables
- sorted associative containersfusion/matching
- pattern matching implementation using nim macros- introduction article: https://nim-lang.org/blog/2021/01/11/pattern-matching.html
There are many ideas of what we could change or where to go next, but those are often poorly thought out. The sheer volume of what we don't know about the existing system, good or bad, is so large we're working in the dark. This is a blindspot induced by the current state of the code base.
What we do know, with great certainty, is that we need tests that not only test things but also:
- teach the reader
- are a useful reasoning tools
- remember decisions of the past
- help uncover lost ideas
- shine a light on dark corners and issues