What Are the Advantages and Disadvantages of Using Whatsapp

2023-04-04 Thread SuRaiYa12R
WhatsApp is one of the most widely used messaging applications in the world, with over 2 billion active users. It has become a popular mode of communication due to its ease of use and various features. However, like any other application, it has its advantages and disadvantages. Advantages of us

Is such HTML template possible?

2023-04-04 Thread alexeypetrushin
Ha ha, this is funny, I see what it does :D type Some = ref object v: int template somefn(a: Some): int = a.v = 2 a.v let some = Some(v: 1) echo somefn(some) # => 2 echo somefn(Some(v: 1)) # => 1 Run Good luck debug

Is such HTML template possible?

2023-04-04 Thread sls1005
As it's `Some(v: 1)` to be pasted, it becomes Some(v: 1).v = 2 echo Some(v: 1) Run

Is such HTML template possible?

2023-04-04 Thread ElegantBeef
Templates are code substitution they place the generic parameters where you call them import std/macros expandMacros: somefn(Some(v: 1)) Run

Is such HTML template possible?

2023-04-04 Thread alexeypetrushin
Hmm, I don't understand, is there docs that would explain what's going on and why it works that way? Here's another strange example type Some = ref object v: int template somefn(a: Some): void = a.v = 2 echo a.v somefn(Some(v: 1)) # => 1

Is such HTML template possible?

2023-04-04 Thread ElegantBeef
Nope templates paste parameters where they match in all places.

Anyone tried GPT-4 for Nim?

2023-04-04 Thread curioussav
I’ve been pretty impressed so far with it for nim. It’s worth a try at the least.

Is such HTML template possible?

2023-04-04 Thread alexeypetrushin
The problem, is this a bug? [play](https://play.nim-lang.org/#ix=4sGv) type Some = ref object v: int proc somefn(a: Some): void = let b = a b.v = 2 echo a.v, " ", b.v template sometl(a: Some): void = let b = a b.v = 2 echo a.

Is such HTML template possible?

2023-04-04 Thread alexeypetrushin
Actually it doesn't work, why code below fails to add the "c"? type HtmlElement = ref object tag: string txt: string children: seq[HtmlElement] template `+`(node: HtmlElement): void = it.children.add node template `+`(node: HtmlEleme

Nim in production #2: 100k+ WebSocket connections on one small VM, lots of CPU and RAM to spare

2023-04-04 Thread guzba
This is a reasonable but also complex question. 1. You can choose how many worker threads you want. I've confirmed having 1k worker threads is totally fine, just totally unnecessary in my case. They all are parked anyway so the overhead is basically zero until and unless you start using them.

Nim in production #2: 100k+ WebSocket connections on one small VM, lots of CPU and RAM to spare

2023-04-04 Thread arnetheduck
Nice! > In total there are 7 threads and this need does not scale with number of > connections. the documentation notes that "handlers" are free to take over the thread and do lengthy processing, as on of the main advantages over `async` \- "block postgresql" is cited as an example - what happ

Nim in production #2: 100k+ WebSocket connections on one small VM, lots of CPU and RAM to spare

2023-04-04 Thread guzba
There is not 100k+ threads. There is 1 Mummy socket thread and 2 worker threads for the HTTP Upgrade requests. Then there is 1 thread receiving on a Redis pubsub connection and 1 thread handling heartbeat intervals. In total there are 5 threads and this need does not scale with number of conne

Nim in production #2: 100k+ WebSocket connections on one small VM, lots of CPU and RAM to spare

2023-04-04 Thread inv2004
It sounds very interesting. Can I ask technical question - did you compare with async solution? Because even if it is loong-running websockets - it is still 100k+ threads with context switch and, probably, most of the time websocket is just waiting. I like Mummy's idea to have simple interface

How could I set up an i386 CI for Nim?

2023-04-04 Thread ringabout
Probably it can switch to windows i386, which isn't dropped.

How could I set up an i386 CI for Nim?

2023-04-04 Thread ringabout
> ##[error]The ubuntu-18.04 environment is deprecated, consider switching to > ubuntu-20.04 or ubuntu-22.04 (ubuntu-latest). For more details, see > actions/runner-images#6002 With `ubuntu-18.04` disabled, the i386 CI doesn't work anymore => Is there

Nim 1.6 vs 2 (1.9) Working with channels

2023-04-04 Thread demetera
Thanks for your analysis. Yes, I saw in documentation, that channels are unstable with the spawn. Meanwhile, there were no issues so far, except mentioned in the initial post. I've removed lines, which were intended to close the channels let commChanDownData = commStopDown.tryRecv(

How to return from a function back to the main application loop

2023-04-04 Thread Naterlarsen
Understood. Will give it another try. Thanks

Nim v2.0.0 RC2 is out

2023-04-04 Thread foxoman
* `nimble install db_connector` nimble install db_connector Downloading https://github.com/nim-lang/db_connector using git Warning: The package has no tagged releases, downloading HEAD instead. Verifying dependencies for

Nim 1.6 vs 2 (1.9) Working with channels

2023-04-04 Thread gs
This seems to be the fixed version... How should we know what was wrong in the other one? But two things... You use spawn, while the docs say > Note: Channels are designed for the Thread type. They are unstable when used > with spawn changed f

Is such HTML template possible?

2023-04-04 Thread alexeypetrushin
It's almost possible with templates :) type HtmlElement = ref object tag: string txt: string children: seq[HtmlElement] template h(html: string): HtmlElement = let node = HtmlElement(tag: html) when compiles(parent_h.children.add node):

Is such HTML template possible?

2023-04-04 Thread planetis
Btw the karax DSL is not that complicated. The mastering nim book has a bare-bones re-implementation that takes 85 lines total. I would start from there.

Is such HTML template possible?

2023-04-04 Thread choltreppe
because all accurances of `tag` get replaced, so the expanded template would be: "some": "some" Run just give the parameter a different name

Is such HTML template possible?

2023-04-04 Thread alexeypetrushin
A minor question, why this template fails? template h(tag: string): tuple[tag: string] = (tag: tag) discard h"some" Run Error: identifier expected, but found 'r"some"' Run

What are Amaze ACV Keto Gummies?

2023-04-04 Thread AmazeKetoGummy
⇉Facebook Link@⇉Facebook Link>>> ⇉Facebook Link@⇉Facebook Link>>> ⇉Facebook Link@⇉Facebook Link>>>

Is such HTML template possible?

2023-04-04 Thread alexeypetrushin
Is it possible to implement such HTML templating? type HtmlElement = object tag_with_attrs: string text: string children: seq[HtmlElement] proc render: HtmlElement: let todos = @["Buy milk"] let editing = true let cla

Is such HTML template possible?

2023-04-04 Thread PMunch
The first test to do when you're faced with "is it possible to do X with a macro" is to check if the syntax parses. By using `dumpTree` from the `macros` module this is fairly easy and it shows that your proposed syntax would indeed be valid Nim: import macros dumpTree:

Nim in production #2: 100k+ WebSocket connections on one small VM, lots of CPU and RAM to spare

2023-04-04 Thread PMunch
I would be interesting to know what the server you're replacing was written in and how the performance of the old server compares to the Nim rewrite. Also a bit of the rationale as to why you've decided to migrate it.