> any chance to re-open?
Nope. The survey is over.
* * *
> One thing I wanted to mention, is that the pair of "no" answers in "Have you
> made contributions" was a very weird choice
>
> (...)
>
> I had the exact same reaction as akavel regarding the "Have you made
> contributions?“
You might be able to use npeg, since it's a pure Nim library:
[https://github.com/zevv/npeg](https://github.com/zevv/npeg)
Try passing diag.getPath().cstring.
Thanks :3
Muy interesante.
I thank you very much for your time to help me
The VS Code plugin is community supported. I do agree that it would be nice to
have an official plugin.
Hello!!, so we created a new web for our tiny Spanish-speaking community here,
thats also a Pastebin, thats also a Playground, has some good features like 120
Examples, machine code and AST of your code and others, we added QR Code SVG
URLs recently too, feel free to visit, should not break too
I don't remember if it was discussed before but I don't see the problem. Never
had a bug because of it, in the worst case you can use `typeof` until your
dependency got fixed.
oups, guess I'm a bit late; I tried to fill
[https://nim-lang.org/blog/2019/12/20/community-survey-2019.html](https://nim-lang.org/blog/2019/12/20/community-survey-2019.html)
but it says it's closed; any chance to re-open? otherwise no big deal
Hello! Nim beginner over here, playing around with wNim and nimbass to learn
nim by creating an audio player. The problem I have is that, no matter how I
try to do it, I can't seem to get an audio file to be correctly made into a
stream. The nimbass documentation says that the file path, on
There is the book "Nim in Action". If you go to the nim home page and scroll
down you will see.
The only thing stopping pegs from being used at compiletime seems to be that it
uses a cstring for it's buffer and accesses the \0 character which causes an
index error at compiletime and is ignored at runtime.
How would I go about disabling index checks in the pegs.nim file? I tried
{.push
When type T is defined private in file test.nim and a public proc p (returns T)
is defined in this file too, and test is imported in test2.nim, test.p can be
used there but test.T can't and at the same time test.p returns T. I saw that
this is forbidden in rust
You can probably use `cstring` if on a C backend, but if you wanted to index
some other element type than `char` (like `int` or `Foo`) you can also do
let foos = cast[ptr UncheckedArray[Foo]](mmaped_file.mem)
if i * Foo.sizeof < mmapped_file.size:
doSomethingWith foos[i]
I also would recommend Kiloneie's videos:
[https://www.youtube.com/watch?v=5tVIsDYPClA](https://www.youtube.com/watch?v=5tVIsDYPClA)
They start with the very basic and work up.
Thank you, that solves my issue :)
You must cast the pointer to a datatype.
Hello guys! I have a quick question to resolve. I mmap some file from disk with
memfiles module as streams and it works great, but some cases involve indexing
mmaped file. Here is what i tried to do:
var mmaped_file = memfiles.open("file", mode = fm_read_write)
var mem_pointer
Do you produce your AST at runtime? Because macros are run at compile time, so
that's too late. It sounds like you are trying to use Nim macros like a JIT, if
I understand correctly
Hi, I'm really interested in making a website showcasing projects made with
Nim. What do you all say?
Can you compile your apk with Android studio without docker? Does it run? I
would try docker approach after I got that to work.
Awesome, thank you very much for the links. Converting my AST to Nim AST is not
my issue. It is putting that Nim AST into a macro to get it to compile which
I'm struggling. I think I follow the basic logic in your compile macro although
I haven't tried to sort out with my code. I'll report back
The output is hard to read. You can use literal (code) formatting by putting
triple backticks on a line before and after your code, [as in
Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting).
Syntax highlighting also works.
Like this:
import macros
template a(x: varargs[typed, `$`]) = unpackVarargs(echo, x)
a "a", "b", "c"
Run
[https://github.com/akavel/hellomello#helloworldapk-built-with-nim-and-no-android-studio](https://github.com/akavel/hellomello#helloworldapk-built-with-nim-and-no-android-studio)
Since `echo` takes a `varargs[typed]` parameter and these are the only
exception to the "take a `varargs` parameter which already is an `openarray` as
the list of args itself" rule, I don't see how to do this. A single parameter
passed to `echo` will always be interpreted as the first of the
I am one step closer, I created a new docker container - after pulling this
image: docker pull bitriseio/android-ndk
Then I installed the following in that container:
apt-get update apt-get install clang apt-get install mingw-w64 apt-get install
-y curl curl
It's been a decade or so since I've used Windows, but IIRC at least one of
cygwin/mingw32/mingw64 contained a linux cross compiler in the repository.
You need static int
type
MatchPool[N: static int] = object # Here, N is an integer
vals: array[N, int]
var mp = MatchPool[3](vals: [2, 4, 1])
Run
If N is not known at compile-time you have to use a seq (or a custom container
with a runtime
`not nil` enforces compile-time checks which provides stronger guarantees. I'd
say it's a first step towards Nim proving formal properties of a language.
For example when interfacing with low-level pointer based API, you might want
to say return a `ptr T not nil` from malloc (because if it was
You can use static[int]. If you want to use array in runtime, maybe use
UncheckedArray[int] or just seq[int]
type
MatchPool[N: static[int]] = object # Here, N is an integer
vals: array[N, int]
var mp = MatchPool[3](vals: [2, 4, 1])
Run
type
MatchPool[N] = object # Here, N is an integer
vals: array[N, int]
var mp = MatchPool[3](vals: [2, 4, 1])
Run
Also, can I create new MatchPool of certain int in runtime in the heap?
According to the survey, Visual Studio Code is by far the most used editor for
nim work. However the VSCode nim plugin is quite out of date. The latest
version, 0.6.4 was released in September, before nim 1.0.0 was released. It
also does not support (AFAIK) using nimpretty and is missing other
Me too. Is opening an issue a contribution? Is writing a library a
contribution? Also I liked to read raw responses as you posted in 2017 survey:
[https://nim-lang.org/blog/2017/10/01/community-survey-results-2017.html](https://nim-lang.org/blog/2017/10/01/community-survey-results-2017.html)
Proc with a "NimNode" input are automatically compile-time, otherwise you can
tag them with {.compiletime.} pragma.
Regarding implementing your own AST with an Expr AST -> Nim AST, you might also
be interested into my step-by-step experiments into writing a compiler in Nim
macros:
I had the exact same reaction as akavel regarding the "Have you made
contributions?“ question. The wording of the last answer was very odd.
37 matches
Mail list logo