Koch is the official tool to build and "koch boot" is the command.
Details here:
[https://github.com/nim-lang/Nim#compiling](https://github.com/nim-lang/Nim#compiling)
You don't install _to_ somewhere, you clone /download to a location and build
in place.
What's the actual path set in settings? Both the current user and the global
path? And what's the Nim directory location? What's the output from finish.exe?
> you clone/download to a location and build in place.
That's what I thought. That's a problem for enterprise software.
Hey!
[This](https://github.com/notTito/nim-100days/blob/master/structures/ringbuffer_concurrent.nim)
could be what you want.
I don't see "install.sh" anymore. I think I need to run "niminst", but "koch
tools" does not build it. How do I build niminst?
Or better: How do I install Nim to a non-standard directory from a source
build? "nim-install my-directory"
I'm sure there is a doc-page I've missed.
I found "tools/niminst/niminst". (Not sure when/how I built that.) But how do I
use it?
*
[https://nim-lang.org/docs/niminst.html](https://nim-lang.org/docs/niminst.html)
Adding a short opinion regarding what should be in the standard library for
v1.0. Keep in mind my background is mostly python, however, I'm still a newb
with Nim.
One of Python's selling points is the large standard library that is
distributed. But one of it's flaws, however, is that it only ha
> Just grab the zip and extract them to some directory.
It is an emerging tradition for modern Windows developers, in sheer child-like
optimism, to run choco install nim first - and then die a little inside when
they see the version number... It is an important ritual, to psychologically
prepar
That's perfect. Thank you.
Yes, N is automatically inferred at compile-time. I also don't think you need
to use the heap but a heap object initialized once and never deallocated works
fine too I guess.
Here you can find a definition from scratch of a custom static array type but
that works like a seq from the outside. I
Thank you for the reply. My concern was that the method has the N generic
parameter in it. Does the compiler just figure that out and so the usage is as
simple as something like:
#--- circBuffer.nim
import ringbuffer
var myBuf*: RingBuffer[N: 8, T: uint8]
Oh, probably. I thought that by "attach" you mean:
type Shape {.inheritable.} = ref object
...
area: proc(Shape): float
type Square = ref object of Shape
...
proc newShape(...): Shape =
...
area = areaShape
proc newSquare(...):
I agree that a big standard library is useful, and that there are areas that
could be expanded (e.g I think the stdlib should include a `heap`
implementation). But it only works if there are contributors interested in
maintaining the modules. For some of the current modules, that's not the case.
I think you over-interpret my proposal. My proposal is mostly a "scoping
extension", the existing overloading mechanisms continue to work.
> I am against reducing standard library.
Fully agreed! To the contrary, I would prefer to expand it.
@nucky9: same versions of VS-Code and Nim here.
@honhon: checked for leftover/crashed nimsuggest instances, none found.
Vs-Code's Nim plugin starts multiple nimsuggest instances, one for every folder
(Nim package) in the workspace. The problem remains even after a fresh install
of Nim and VS-Co
async lib is single thread.
> @[] and "" don't have to actually differ from nil, it could be an
> implementation detail. Pretty much like option[ref T not nil] can be
> implemented as ref T.
Yep. And that's how it will be done.
I am against reducing standard library. Many developers find C++ useless
without boost, python has huge stdlib and its main advantage of python. Dead
code elimination on Nim makes less of a pain to import large libraries.
Installation of third party libraries is always a pain. Corporate firewall
@Araq
Well, I don't think it's possible to use generics in this solution. As far as I
know, Rust's trait objects are implemented in a similar manner and they lack
generic methods (that's one of the reasons why it's often advised to use
generic traits rather than generic methods within non-gener
@mashingan
No, it's not about number of arguments. See that:
proc fun(x,y: int) = echo x+y
proc gun(x,y: int): int = x+y
fun 1, 2 # works fine
let x = gun 1, 2 # doesn't compile
let x = gun 1: 2 # compiles (!), although it looks weird
Just like GULPF sa
@GULPF
That's very interesting, actually! I never thought I'm SO mainstream using so
many macros.
@didlybom
But strings and sequences ARE already treated a little differently than plain
reference object types, aren't they? The most trivial example being: strings
have their literals and sequences (and arrays) have `openArray` but neither
string nor sequence has object constructor. So what no
Yes, it works for thread, async.
> running Nim code on a medium size MSP430 32K Flash, 4K RAM. The
> MSP430F5510-STK board from Olimex.
Interesting. Can you access all the registers already? Do you use GC? Your
project based on
[https://github.com/lonetech/nim-msp430](https://github.com/lonetech/nim-msp430)
?
Circular buffer
type
RingBuffer*[N: static[int],T] = ref object #N=size, T=type
buf: array[N,T]
head, tail: int
proc add*[N, static[int],T](self: var RingBuffer[N,T], data: T) =
# some stuff
and I don't think you need ref object for your use case.
Threads using TinyC never works for me on Windows, iirc.
TinyC on Windows works well.
The TinyC compile speed and code optimization is not as good as vc, but it is
so small, the total size of tcc compiler and header/lib file is no more than 2M.
It can compile the nim compiler successfully!
Unlikely but I never got TinyC to work on Windows.
Hello,
I am a young embedded software engineer, small microcontrollers almost
exclusively, C exclusively. I'm very excited about what I see in Nim, but I am
having trouble translating some concepts that I could do in my sleep in
embedded C or assembly. I wonder if I'm just trying to shoehorn in
Just grab the zip and extract them to some directory.
[https://nim-lang.org/download/nim-0.18.0_x64.zip](https://nim-lang.org/download/nim-0.18.0_x64.zip)
The _cas code in `atomic.nim` for `tcc` of windows is disabled.
elif defined(tcc) and not defined(windows):
when defined(amd64):
{.emit:"""
static int __tcc_cas(int *ptr, int oldVal, int newVal)
{
unsigned char ret;
__asm__ __volatile__ (
I'm not a window guy and I've found installing Nim easy on Linux and Mac
however I tried to install Nim on a windows test machine and found it
difficult. Its still now working. I tried both the download on the website and
choosenim. The nim installer seems to think the path is set but it definit
Maybe restart vscode or check that there are not any nimsuggest servers still
running/crashed.
Thanks! I'll change the libraries to match up with these guidelines on the next
release.
`compiles` takes an expression argument, not a string argument. I myself don't
know a way to do this other than to do something like:
import macros, times, tables
macro m(o: typed): untyped =
let oti = getTypeInst(o)
let s2 = oti.toStrLit.strVal
let s2ident
I guess the NEP needs a link to this document:
[https://nim-lang.org/docs/apis.html](https://nim-lang.org/docs/apis.html)
**TL;DR:** You should define a ` newFruit` procedure which performs the
"setup". That answers #1 and #3. (Note that for non-ref object the convention
is `initFruit`)
As for
[EDIT] Well, does not even work correctly, expected result would be
"times.DateTime". "When compiles()" give the same.
import times, macros
macro m(o: typed): untyped =
#let ot = getType(o)
let oti = getTypeInst(o)
#let s1 = $ot.toStrLit
let s2 = $oti
38 matches
Mail list logo