But obviously you need a systems language for writing such lean, fast, reusable
tools, and I think Nim or D are the best candidates.
Yep, I also forgot about D. Before I discovered Nim, that was my #1 system
programming language. Now - speed-wise - I'm definitely having a conversion...
**Re: Nim**. I couldn't agree more. If there is ONE thing I absolutely _do not_
like about the language is the issue with the modules. Basically, to keep my
head in some state of sanity, I try to keep everything in as few modules as
possible, and "including" the rest of it (for "modularity") - w
I guess Nim's main problem is it's recursive module dependency. Its killing my
module structure, I need to re-arrange all the stuff.
@cantanima, Yes. I've tried Kotlin a few weeks ago, but without exe file, i
can't do anything in windows. So i quit trying. Anyway, happy to hear that
there is an option. Thanks.
Shell scripting. (I use `mksh`, slowly thinking of transitioning to `zsh`.) I
find myself being able to do a huge fraction of my tasks with just shell,
common Unix tools, and some very useful new command line tools (ex `jq`,
`curl`, etc). I make heavy use of running `$EDITOR` (ex `vim` or `kakou
Curious what is the difference between libgpiod and wiringPi ? I've had no
issues just calling directly into the wiringPi C API
No, the final enum has the export marker and the group macro adds an entry for
the final enum and creates an optional enum with suffix "Msg" for actions (with
the export marker too):
import macros
# Groups Enum
var groupEnum {.compileTime.} = newNimNode(nnkEnumTy).add(
Aren't you just missing the export marker in the generated intermediate enums?
i agree... now give us an intermediate tutorial!
More compact source code you may get with something like
var a: array[32, byte]
var p: ptr uint64
var myUint64: uint64 = 123456
p = cast[ptr uint64](addr a[8])
p[] = myUint64
Run
but so you have no influence on endianess and of course you have to ca
I'd say my favorite programming language since about 20 years is Python and
it's also the language I use most professionally. I like that it's quite
expressive and has lots of libraries (not only external libraries, but I also
like the standard library a lot). _Especially_ for small tools the la
Like:
* Python: Code looks clean, gets stuff done quickly, easy to hire people
* JavaScript: Performant (thanks to browser wars), runs everywhere,
Babel+Typescript/Flow make it bearable
Dislike:
* C++: bloated, messed up, pays too much attention to useless stuff and yet
cannot easily t
@mratsim, Sorry. I should have been more specific.
I didn't mean to compare Weave to those Rust libraries in terms of features. I
was comparing them in terms of library size and level of abstraction (for lack
of a better phrase.)
What I meant to say is both Tokio and Rayon are "runtime" librari
thanks, i do that, but the real problem is that i need import the enum before
other groups are generated, i get an `undeclared identifier` error
Module A
from builder import groupType
#Generate the enum type
groupType(Groups)
type GroupsSet* = set[Groups]
Thanks!
Haha. I guess, it does.
Perhaps, the more obscure the language, the better chances you have to find a
project to work on (if you are an expert at it, I mean)
@kcvinu If you mean me (about Kotlin), download and use [Kotlin
Native](https://kotlinlang.org/docs/reference/native-overview.html). I think
I've done it once a while back.
I think we're doing two different kinds of diff. My library takes sequences `a`
and `b` and returns a sequence of "spans" (i.e., insert/delete/replace a from
to, b from to) that if applied to `a` would transform it into `b`. This is
explained in the Python [difflib
docs](https://docs.python.org
Thanks, fix is here
[https://github.com/nim-lang/Nim/pull/12935](https://github.com/nim-lang/Nim/pull/12935)\--gc:arc
is what --newruntime evolved into, see
https://github.com/nim-lang/RFCs/issues/177|
---|---
Your usage of `owned` is correct.
@e Yes, it seems that's a bug that wasn't revealed by my existing unit tests.
Thank you!
I'll look what I can do. :-)
> And i dont want to mix the implementation code with type declaration code. I
> need to split as much code as possible.
In different modules or in different files?
If in different modules, as for now, everything exported are visible to other
modules that import it.
If it's only needed in diff
Whoa!! Super-weird. Didn't even think of that...
Thanks! :)
Hi, so the following code implements bfs search in a graph with adjacency
lists. I have doubts if this is the correct way to use `owned` so please take a
look:
import deques
type
Edge = object
neighbor: Node
Node = ref object
neighb
but uint is... what?
uint64 is not an ordinal
[https://nim-lang.github.io/Nim/manual.html#types-ordinal-types](https://nim-lang.github.io/Nim/manual.html#types-ordinal-types)
Probably, I'm only person in my city, who freelanced with Boo.
This is my use case.
# module A
type
Control* = ref object or RootObj
m_text* : string# ( This should be private)
handle* : HWND # ( This can be public)
...
# module B
import A
# here is the implementa
The next interesting question would be how many of us _do_ actually use our
favorite language on a daily basis (meaning: professionally)
See example in Synthesis:
[https://github.com/mratsim/Synthesis/blob/3a443cf3/synthesis/factory.nim#L77](https://github.com/mratsim/Synthesis/blob/3a443cf3/synthesis/factory.nim#L77)
I.e. Gather everything in a compile-time table or sequence and use a final
macro `generateGroups` that read it.
I have an advanced differ for arbitrary Nim types if you want to study how to
transform yours into macro. My use-case is for a test suite so I throw an
exception as soon as there is a mismatch.
[https://github.com/status-im/nim-beacon-chain/blob/9050db7b/tests/helpers/debug_state.nim#L39-L114](h
A `runtime` means something that operates at `runtime` with extra overhead
compared to anything done at compile-time by the compiler. It also means
potentially interoperability issue.
For example, a garbage collector or a reference counting scheme is also a
runtime, extra overhead, not done at
I perfectly understand what you're saying. I've benchmarked seq s myself _a
lot_ and my conclusions are pretty much the same. The add s were left there for
the sake of the example - my main concern was to get it working, and optimize
the masking part first.
But I obviously see your point - I'll
I'm trying to write a "switch-case" statement like:
case MyVal
of...
Run
where MyVal is of type "Value" (which is defined as a uint64).
How do I make the compiler interpret it right (since an uint64 is obviously an
ordinal type)?
1. _PureBasic_ for sheer coding transparency and awesome standard lib.
2. _CoffeeScript_ for code elegancy and interchangeability with ES.
3. _Boo_ for being still more well-thought than C# in awesome .NET ecosystem.
4. _Nim_ for optimization opportunities and custom DSLs.
`# placeholder just to make the compiler shut up type Storage[T] = seq[T] proc
newStorage[T](size: int): seq[T] = newSeq[T] size proc components[T](x: var
seq[T]): var seq[T] = x type Entity = object id: int ComponentMotion = object
x, y: float template setupComponent(t: typedesc) = var x {.used
We had discussed that in the past, seem there is still no better solution:
> [https://forum.nim-lang.org/t/4745#29623](https://forum.nim-lang.org/t/4745#29623)
It should be obvious that for high performance you should avoid many add()
operations for sequences. add() is a not trivial proc call, even when inlined
it has to check if buffer is full and needs reallocation, and it has to
increase len field. What was not that obvious for me is how much slower
You'd have to gather group names in a compileTime variable.
I ended up hacking a half-assed type system into the macro haha. If anyone has
a better idea please let me know.
I've ported Python's difflib's sequence matcher to pure Nim:
[diff](https://github.com/mark-summerfield/diff).
It can be used to see the differences between any two sequences of items that
support `==` and `hash()` (string, char, or any custom item type with the
necessary support).
Search is great if you know what you're looking for. But it is useless for
getting an overview of what's available. And an overview of the third-party
libraries is what I want when starting with a new language.
Something similar to this:
[https://play.nim-lang.org/#ix=24QX](https://play.nim-lang.org/#ix=24QX)
Alternatively, if there's a way to check if an Ident from an untyped AST is of
type ntyObject, that could work too. I just need that check in _one_ place in
my macro.
If you need to access the field from other modules, then it's literally not
private anymore.
If you have specific function that have to work with that private field, then
implement it in that common module and have that function exported.
If you want to have read only for that specific field, i
Thanks : ) LET'S CONTINUE
import actors
type
ComponentMotion = object
x, y: float
#boilerplate
var storageComponentMotion* = newStorage[ComponentMotion](100)
proc componentMotion*(self: ent): ptr ComponentMotion =
return addr stora
Foutcode 0xf1 krijgen met mijn Epson-printer ... Ik ben geen technische zeeman,
dus op zoek naar epson-ondersteuning !!!
Bezoek ook deze links
[https://www.klantenservicebelgies.com/epson-belgie](https://www.klantenservicebelgies.com/epson-belgie)/
Ok, So there is no option.
Maybe casting the addr of the uint64 var to ptr array[4, bytes]?
Right now this is how I'm doing it, but it definitely doesn't look very...
efficient:
(Value is just a uint64)
proc writeValue(v:Value) =
CD.add(Byte(v shr 56))
CD.add(Byte(v and Value(0x00ff)))
CD.add(Byte(v and Value(0xff00)))
Hmmm I think I already figured it out.
There were obviously object files remaining from a previous build (that is:
_before_ the OS upgrade).
What I did to "solve" it (make the warnings disappear actually) was to do a
\--forceBuild:on release, and have the object files re-generated.
Once I
OK, so after a lot of hesitation, I decided to upgrade my system to 10.15 (I
hope I won't regret it).
Now after compiling my project as usual, I'm getting the following warnings:
ld: warning: linking module flags 'SDK Version': IDs have conflicting
values ('[2 x i32] [i32 10, i32 1
50 matches
Mail list logo