Projects:
- Graphics module for Nim. Currently based on SDL v1.2. (new project)
- Emerald: macro-based HTML templating engine
- Patty: pattern matching library
Forum:
- NimScript
- Make global assignment by reference (difference between the shallow and deep copy)
- Re: QtCreator plugin
- Any samples documenting use of asynchttpserver?
- Asyncnet example
- Evolution of Nimble
Core development:
Generic types in macros, experimental new config system based on NimScript, macros.getImpl
to access the implementation of a routine or a constant, Improve performance of readLine by using fgets, parallel
now requires --experimental
mode, toplevel .closure procs are deprecated, doc of pragmas moved to manual, js time fix, staticExec: redirect stderr to stdout so stderr is returned too, workaround windows findNextFile
bug, fixed UTF-16 to UTF-8 conversion in widestrs.nim
Example code for this week:
nimble install emerald
Then the following code prints some html code:
import emerald
proc templ(numItems: int) {.html_templ.} =
html(lang="en"):
const myTitle = "Title"
head:
title: myTitle
body:
if numItems > 0:
ul:
var content = "x"
for i in 1 .. numItems:
li: content
content = content & "x"
var
ss = newStringStream()
myTempl = newTempl()
myTempl.numItems = 3
myTempl.render(ss)
ss.flush()
echo ss.data