Array Difference

2021-04-05 Thread Stefan_Salewski
Yesterday i was not able to find a proc for the array difference known from other languages like Ruby. I think I was searching for it already five years ago when I was new to Nim. It is available maybe with a different name already? As we use & for concatenation of sequences, using `-` from Rub

Might there be a better `dotOperators` design?

2021-04-05 Thread saem
You might be onto something. Working through a bunch of examples of it working and also acting poorly will help test whether it's a good idea. Generalizations that reduce the number of rules in a language are typically a very welcome thing, fewer concepts more leverage. One way to do that is the

What is happening under the hood of "cast" function ?

2021-04-05 Thread Stefan_Salewski
I have a section about cast and type conversion in the Nim for kids book: Have you missed it, is it unclear?

Multi-threaded features needed for Server

2021-04-05 Thread b3liever
> b) Or immutable complex data structures, like server config, code below won't > compile: I think the only viable solution to that is to make server a global and protect it with locks.

Twitter in 100 lines of Nim, no JS

2021-04-05 Thread alexeypetrushin
Thanks :). The answer for both questions - because of simplicity. Proper JS packager like WebPack would be a better option but it would require more code to write and maintain. Websockets are also better, but require to write and maintain more code - on the client - to handle reconnections and

Twitter in 100 lines of Nim, no JS

2021-04-05 Thread mikebelanger
Neat stuff! And thanks for making the accompanying video. Looks like you're using deno to build out the JS too. If I may ask, what are the advantages of using Deno in this context? Regarding the nim part - is the plan eventually to incorporate some Websockets tech? Lots of those new HTML-on-the

Might there be a better `dotOperators` design?

2021-04-05 Thread rb3
Hey guys, I've been using the `dotOperators` feature since I started my game engine project 2 years ago. I use it to interface with C++ libraries, and for the most part it works amazingly. Being able to implicitly generate Nim bindings to a C++ library as you use it in your code is sick, IMO. I

quit considered evil: bypasses `defer` and `try/catch/finally` which might do important cleanups

2021-04-05 Thread xioren
Yeah I guess that was a bad example. But quitting from outside of a main still presents an problem.

quit considered evil: bypasses `defer` and `try/catch/finally` which might do important cleanups

2021-04-05 Thread shirleyquirk
`return` from a main proc

Library for making lightweight Electron-like HTML/JS GUI applications

2021-04-05 Thread Niminem
Finally I've had the time to make another release! Neel v0.3.0 Updates: * added ability to call JavaScript anywhere within a procedure freely/multiple times via `callJs` macro * added ability for `callJs` macro to be used in your other modules procedures * removed the need for procedures

Nimview - a lightweight UI helper

2021-04-05 Thread NecroticOoze
Yes- this can be mitigated by using Neel lol

Multi-threaded features needed for Server

2021-04-05 Thread mikra
well 1) looks like a bug in your application to me. use valgrind or do a code review. 2) unsure - for me it was easy (but that's my subjective opinion). I developed some pooling utility years ago. Just look at how it was done. Originally developed with Ni

What is happening under the hood of "cast" function ?

2021-04-05 Thread ElegantBeef
Typically when you cast a variable to another it runs a procedure to convert it to the given type, since most types differ in their underlying bit representation. For instance `10.3.int` the `int(float)` conversion truncates the decimals. Now you also have a bit for bit `cast` which is `cast[in

Nim as Cmake alternative

2021-04-05 Thread ynfle
See nimscript ([nims](https://nim-lang.org/docs/nims.html)) and [nake](https://github.com/fowlmouth/nake) There is also a thread on the forum about it but I not sure where it is

quit considered evil: bypasses `defer` and `try/catch/finally` which might do important cleanups

2021-04-05 Thread xioren
What would be the recommended way to exit in the scenario where the user input --help Run and all that needs to happen is printing the help string and exiting?

Multi-threaded features needed for Server

2021-04-05 Thread alexeypetrushin
I tried to [create Web Framework in Nim](https://forum.nim-lang.org/t/7749), and think there are some things that could be improved. 1) Errors in multi-threading mode Sometimes server crawhes with `SIGABRT pointer being freed was not allocated` or `SIGSEGV: Illegal storage access.` or hangs and

What is happening under the hood of "cast" function ?

2021-04-05 Thread kcvinu
Hi all, Almost all programming languages i met are using "cast" function to convert data types. I wonder what is happening under the hood of this so called "cast" function. I am sorry if i misuse the word function here. can anyone could explain it ? Thanks in advance.

quit considered evil: bypasses `defer` and `try/catch/finally` which might do important cleanups

2021-04-05 Thread timothee
=>

Get size of block device?

2021-04-05 Thread xioren
Ah makes sense. I guess the same applies for writing to block devices. Thanks!

Twitter in 100 lines of Nim, no JS

2021-04-05 Thread alexeypetrushin
Hi, would like to share a demo of new Web Framework, Twitter clone [Short Video](https://www.youtube.com/watch?v=Lxp48LI39Cs) It's reactive, the UI updated automatically after you change the model. * No JS, no Client-Server API, (almost) no need to explicitly modify UI * SEO friendly, fast f

SLOT ONLINE TERBAIK DAN TERPERCAYA 2021

2021-04-05 Thread slotonline
VIVA98 SLOT ONLINE TERBAIK DAN TERPERCAYA 2021

Get size of block device?

2021-04-05 Thread MonkeeSage
This works for me on linux using the BLKGETSIZE64 ioctl import std/posix let BLKGETSIZE64 {.importc: "BLKGETSIZE64", header: "linux/fs.h".}: uint let path = "/dev/sdd" var usb: File var size: int if not open(usb, path, fmReadWriteExisting): rai

Learning Nim: Creating a Query Macro [video]

2021-04-05 Thread DavidKunz
Hi @shirleyquirk, I also made a few videos on how to configure Neovim, in case you're interested: Config (if others are interested): Best regards, David

Nim as Cmake alternative

2021-04-05 Thread acroobat
Can i use Nim as automatic building system? For example `nim c main.c`.

Learning Nim: Creating a Query Macro [video]

2021-04-05 Thread shirleyquirk
I would love to see your vimrc/init.vim. Your workflow always looks so effortless.

Check out my new lib Spacy: Spatial data structures for Nim.

2021-04-05 Thread Stefan_Salewski
> Hardly, it's "Data oriented design" and becoming more popular as it's a good > way to squeeze out more performance. But I agree it's usually more > inconvenient to use. I heard about "Data oriented design" and Entity–component–system (ECS) a few times in the last decade. But my feeling was th