would `nim r -d:release src/app.nim` on a second run without changes be as fast
as `nimble build -d:release` and then `./app` ? Or is there any additional
overhead with this approach?
This seem to be the easiest approach for projects where relying on the
availability of nim compiler is not an i
makes sense, I'm not there yet so I am just forethinking about future
roadblocks. I can imagine a typical use case would be to distribute the binary
in npm and then being able to resolve the /lib from node_modules correctly,
also distributing via other package managers e.g. for linux distributio
I got something basic working using nimscripter.
One part I am maybe not fully grasping is how to embed a small stdlib.
@PMunch in your article you mention using nimsuggest to get a list of needed
files, but ultimately those files still need to be shipped together with the
binary executable and
Hi, coming from a background of mostly dynamic languages, when it comes to
compiled ones I always struggle to translate some common patterns that heavily
rely on dynamicity (e.g. user configs especially when "scriptable", plugin
systems, etc. ).
I apologize if some of my doubts and intuitions m
may have to dig deeper in the `BaseLexer` source, but I think the problem is
not about reading a large file, but the fact that the lexer buffers one line at
the time and has this `BufLen` limit instead of having something like a moving
window or similar. My assumption is that this works well for
Thanks for the extensive example, I will have a look in detail.
Maybe, though, my problem was not too clear. I have no problem in ignoring the
new lines or white spaces. My issue is that when using the `open` method of
`BaseLexer` with the default `BufLen` and I try to parse a file where all the
Hi, I have a quick question about `BaseLexer` `open` method in `std/lexbase`,
that given your experience on the topic you may have an answer for.
It seems that the lexer is optimized for line based parsing? What is the best
idiomatic way to parse a language that can ignore new lines? Currently f
I'm on version 1.6.8 I can try updating
anyway if I run `nim c -r --forceBuild --verbosity\:0 --hint\[Processing\]\:off
--excessiveStackTrace\:on test.nim`
or even just `nim c test.nim`
it compiles without warning and outputs
foo
hello
Run
if I run with `nim c -
not sure if I got the issue right. If the problem is related to partial
initialization, why it affects also accessors?
e.g.
# node is correctly initialized with all fields
let n = Node(kind: nkChild, name: "foo")
case n.kind
of nkChild: echo $n.name #using case statement
the problem seems to happen inside loops:
let list = @[Node(kind: nkParent), Node(kind: nkChild)]
for node in list:
case node.kind
of nkParent:
node.children = @[] # inside the loop results in warning, if not in a
loop is fine as in previous post
of
ok, this is working:
let a = Node(kind: nkParent)
case a.kind
of nkParent:
a.children = @[]
else: discard
Run
I guess it makes sense as the kind could change at runtime so the compiler
needs a case or if to infer it.
Still on a more complex code I ha
sorry if the code is not too clean, when I do
let a = Node(kind: nkParent, children: @[]) # this is fine (now warnings)
echo $a.children # this throws a warning (cannot prove that field is
accessible)
Run
Myabe I am missing something, but was expecting that once `a
cool, I have 2 questions/issues though:
1\. I was able to enable the warning using a pragma like
`{.warning[ProveField]: on.} ` on top of the file, but not sure how to pass it
as a compilation argument. I tried nim c or nimble build with that argument and
it says `no matches found: --warning[Pr
Given a simple "kinded" object like:
type
NodeKind = enum
nkParent,
nkChild
Node = ref NodeObj
NodeObj {.acyclic.} = object
case kind: NodeKind
of nkParent:
children: seq[Node]
of nkChild:
name: strin
hi, I have a question about usage of enums to model a tree structure (e.g. AST).
type
NodeKind* = enum
Sheet,
Comment,
Rule,
AtRule,
Decl
Node* = ref NodeObj
NodeObj* {.acyclic.} = object
case kind*: NodeKind
15 matches
Mail list logo