Proposed table changes - get and getOrDefault

2021-06-24 Thread arnetheduck
`tables.withValue` is a bit of an abomination - it requires a mutable table even for read-only cases _[and](https://forum.nim-lang.org/postActivity.xml#and) it unnecessarily exposes a `ptr` with all its issues (lifetime etc) - if anything, it should be deprecated, not used as a rationale for in

Attempt to read from nil, Arc bug?

2021-06-24 Thread codic12
I don't really care where the thread is allocated as long as it works and I don't have to worry about it after I spawn it, which is what detach in C++ does. Is there a Nim equivalent?

Attempt to read from nil, Arc bug?

2021-06-24 Thread codic12
Oh yes I see the issue. I changed it to use an array of size 1 everywhere, the issue was the implicit null terminator. Thanks for pointing me to the right way!

Windows : how to get active window title

2021-06-24 Thread rockcavera
Try it with `GetForegroundWindow()`

Windows : how to get active window title

2021-06-24 Thread IvanS
In Windows I'm trying to get the title of the active window. I want to send keystrokes to an app, but can only do that if it has the focus, or the keyboard entry will end up in the wrong application. So I need to check first. However, I get an empty string with this code : import w

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread zulu
Thanks for the video.I think it's important to listen to the biggest users of Nim.

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread stefantalpalaru
Can we get Araq a copy of ?

Nim 2.0 -- thoughts

2021-06-24 Thread Araq
> I think I had an interesting idea, namely that Types, per se, are a case of > premature optimisation. Using the least number of bits to represent something is a state space reduction and as much about correctness as it is about efficiency. And I don't believe in "premature correctness". ;-)

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread Stefan_Salewski

slim - fork version of nimble , handle task level dependency

2021-06-24 Thread timothee
> Maybe we should take this as a sign that the current state of Nimble isn't up > to the community's standard ? maybe this is a sign that nimble needs people to write PRs so we can improve what we have instead of splitting ecosystem.

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread stefantalpalaru
> I wonder why you think that.

nim-ws - websockets for Nim

2021-06-24 Thread treeform
Looks great! And passing such a big independent test suite. That's a ton of work, congrats.

harmony os

2021-06-24 Thread xflywind
That would be a good/viral marketing. We need to wrap the [lite OS](https://codechina.csdn.net/openharmony/kernel_liteos_a)(the open source part of Harmony OS for IOT not for phone) APU, then claim Nim adds support for "Harmony OS" and write a good marketing article. The other part of Harmony O

Nim 2.0 -- thoughts

2021-06-24 Thread freeflow
I am a bear of very little brain but recently, during a prolonged wrestling match with the type system in Visual Basic for Application' I think I had an interesting idea namely that Types, per se, are a case of premature optimisation. It seems to me that Types come with a whole host of hidden a

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread Stefan_Salewski
> I think we're going in the wrong direction with RC. I wonder why you think that. Of course ARC and ORC was hard for the devs, but I think the old refc GC was also hard, at least with good realtime behaviour. ARC/ORC has generally good performance (still with some exceptions), and the determin

C++ (new) modules vs. Nim modules

2021-06-24 Thread Sixte
I refer to the C++ example given above. Because of the hidden module type (hidden outside the module), functions can't be applied to the module from the outside. They can only be injected and need to be converted (instantiated ) by the module itself. An instantiated function then makes a change

C++ (new) modules vs. Nim modules

2021-06-24 Thread Sixte
Without the export and module annotations, g++ will compile the following example. We have a module type (module structure) MS, and a module instantiation MI. None of these gets revealed to the outside. The module can be compiled separatedly, no dependencies with an importing program. :private t

slim - fork version of nimble , handle task level dependency

2021-06-24 Thread bung
there're several issues exists on nimble repository , so developers are awared. nimble lack of some features compare to other language's package manager .

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread deduck
RTTI is however not necessary. As a matter of fact, some popular coding guidelines discourage it for C++. A language with a strong typing system, Haskell, does not have RTTI and neither does Rust (even if I don't like comparisons with other languages). If someone was strong RTTI, the community

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread zetashift
> Compilation time has gotten much slower. Any numbers on this?

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread stefantalpalaru
> About procedures using type classes being compiled to specialized generic > procedures, can this ever be a problem in practice? There is no run-time type information since there is no run-time type. The type is a lie!

harmony os

2021-06-24 Thread Araq
It seems to me that in order to support Harmony, Nim's produced C(++) code must be compatible with their "Ark compiler" but I don't know how to obtain it. The porting is likely to be very simple.

Nim 2.0 -- thoughts

2021-06-24 Thread Araq
> I understand one needs to get some sort of invitation or make some sort of > application? You need to create a pull request here:

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread stefantalpalaru
> Use ARC/ORC. [amd] 14 Thu Jun 24 10:29:47 |/mnt/sde1/storage/nimbus-eth2| stefan$ rm -rf nimcache; make -j8 NIMFLAGS="--gc:orc" nimbus_beacon_node Building: build/nimbus_beacon_node /mnt/sde1/storage/nimbus-eth2/vendor/nim-metrics/metrics.nim(254, 14) template/generic i

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread alexeypetrushin
> Nim fills a niche as a Python replacement for easy interfacing to C +1. I continue using Nim for one-time-run single-threaded python-like data processing scrips, but stopped using it for anything else. For web or fast and reliable networking services, in its current state it's just too hard to

Nim 2.0 -- thoughts

2021-06-24 Thread GordonBGood
> Can you share your experimental code somewhere please? Sure, I have been thinking of how to do that, as I need some code review on the way to a PR. Just cleaning up the code a bit before I post it. In cleaning up the code, I found that I like using `std/isolation` a lot as it makes things sim

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread cdunn2001
> So it is that exact case mentioned in Sean Parent's presentation :), right ? Yeah, but it's a bug in the library, not the language. A better criticism would be that the language has not settled. I'd rather not waste time on fixing "threadpool" until 2.0 is available. (I suspect that the global

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread planetis
> I think the talk could have been accepted, honestly But the "rationalizing xxx" thing at the beginning was kinda inappropriate. If it was phrased better, I would agree with you.

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread deduck
I think the talk could have been accepted, honestly - it's well researched and I think it's good to listen to critical voices in the community. I agree that the GC shouldn't be super high-priority (reference counting makes a lot more sense, especially when performant C-compatible GC'd languages

slim - fork version of nimble , handle task level dependency

2021-06-24 Thread Clonk
This is at least the fourth Nimble replacement that has been developed by the community. Maybe we should take this as a sign that the current state of Nimble isn't up to the community's standard ?

Life is a struggle - a struggle with Nim (video)

2021-06-24 Thread planetis
> So it is that exact case mentioned in Sean Parent's presentation :)