Moved to https://github.com/haxscramper/site/blob/master/nimskull-notes.org
TU(records=[], | |
enums=[Enum(fields=[EnumField(name='GIT_FEATURE_THREADS', value=''), | |
EnumField(name='GIT_FEATURE_HTTPS', value=''), | |
EnumField(name='GIT_FEATURE_SSH', value=''), | |
EnumField(name='GIT_FEATURE_NSEC', value='')], | |
name='', | |
base=QualType(name='', spaces=[], parameters=[], is_const=False, is_ref=False, is_pointer=False, is_function_pointer=False, is_method_pointer=False, is_namespace=False, dbg_origin=''), | |
doc=''), | |
Enum(fields=[EnumField(name='GIT_OPT_GET_MWINDOW_SIZE', value=''), | |
EnumField(name='GIT_OPT_SET_MWINDOW_SIZE', value=''), |
#!/usr/bin/env python | |
import yaml | |
import textwrap | |
from typing import * | |
def indent(text, amount, ch=" "): | |
padding = amount * ch | |
return "".join(padding + line for line in text.splitlines(True)) |
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
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
Base C++ class cppbase.cpp
#pragma once
#include <stdio.h>
struct CppBase {
virtual void baseMethod(int arg) {
printf("arg from nim - %d -\n", arg);
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: |
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: