<< 04-09-2018 >>

00:03:49FromGitter<arnetheduck> ok, must be something about my setup then.. installed choosenim recently, might have messed things up
00:04:10FromGitter<arnetheduck> zachcarter, thanks for checking!
00:04:43zachcarterarnetheduck: sure thing
00:10:12*PrimHelios quit (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)
00:10:37*PrimHelios joined #nim
00:14:24FromGitter<metasyn> is there a good portable way of downloading something to a temporary directory? ⏎ ⏎ I found https://nim-lang.org/docs/ospaths.html#getTempDir, but it says to not use it
00:14:56zachcarterhonewatson: https://github.com/dom96/httpbeast/issues/11
00:19:53FromGitter<honewatson> thanks @zacharycarter briefly looking through the httpbeast code base I don't think it has support
00:24:53zachcarteryeah - will be interesting to see dom's response
00:27:54zachcartermetasyn: it says only not to use on android
00:28:09zachcarterso if you're not on android - https://nim-lang.org/docs/ospaths.html#getTempDir, - should work fine
00:28:40FromGitter<metasyn> > and on other Unix based systems it can cause security problems too ⏎ ^ that sounds... interesting haha
00:28:51zachcarterwell then provide the compiler flag?
00:29:14FromGitter<metasyn> its for a larger project, so i'd rather not make ever person using it as a downstream project require said flag
00:29:43zachcarterso put it in your project
00:29:50zachcarterand figure out what OS the user is running on
00:29:53zachcarterand set it
00:30:15FromGitter<metasyn> that is true, i could do it
00:30:21FromGitter<metasyn> but then why use it to begin with :p
00:30:28FromGitter<metasyn> since i'm already doing all the work
00:31:11zachcarterwell A) it's not that much work - it's probably like 4 or 5 lines to support all the most likely OS's that will be using your bin / lib
00:31:14FromGitter<metasyn> adding a switch for C:\temp and /tmp doesn't seem very hard. it *feels* like that would cover the main scenarios
00:31:14FromGitter<metasyn> yeah
00:31:29FromGitter<metasyn> i guess that is what i would expect a getTempDir thing to do itself
00:31:43FromGitter<metasyn> but if the suggestion is to re-write it, that might be the "nim" way in this case
00:31:52zachcarterI think the problem is that not every linux distro is guaranteed to implement it the same way
00:32:05zachcarterand the OS's have built in tooling for this
00:32:16zachcarterlike - https://www.gnu.org/software/autogen/mktemp.html
00:32:52zachcarterso you really can't guarantee if a user is going to be using the OS default impl or some other impl
00:33:06zachcarterit's best to provide sensible defaults and allow them to be overridden
00:33:24zachcarterwhich I think is what `getTempDir` does - but it warns you about this fact
00:38:11zachcartermetasyn: pretty easy to see what it's doing here - https://github.com/nim-lang/Nim/blob/master/lib/pure/ospaths.nim#L525 - it's not actually provisioning a temporary directory for you
00:38:50zachcarterit's just suggesting /tmp for non-windows OS's and C:\temp for windows
00:44:57*cmk_zzz quit (Quit: leaving)
00:46:10FromGitter<metasyn> hmm that is simple. the docs are a little misleading, as its not obvious that the warning only applies to the context of android (to me)
00:46:32FromGitter<metasyn> I should've just read the source to begin with haha
00:48:01zachcarteralways read the code :) - it clarifies everything :D
00:48:17zachcarterunless it's compiler magic and then you're digging :Po
01:02:40*noonien quit (Quit: Connection closed for inactivity)
01:05:58*abm quit (Ping timeout: 246 seconds)
01:08:17*PrimHelios quit (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)
01:08:43*PrimHelios joined #nim
01:34:30*brainpro1 quit (Ping timeout: 272 seconds)
01:35:52*ftsf joined #nim
02:01:22*brainpro1 joined #nim
02:35:43*PrimHelios quit (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)
02:36:07*PrimHelios joined #nim
02:36:30*PrimHelios quit (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)
02:36:52*PrimHelios joined #nim
02:38:18*PrimHelios quit (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)
02:38:41*PrimHelios joined #nim
02:44:55*krux02 quit (Remote host closed the connection)
02:47:55*endragor joined #nim
02:51:38*PrimHelios quit (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)
02:52:00*PrimHelios joined #nim
02:54:48*captainkraft quit (Ping timeout: 244 seconds)
02:55:26*captainkraft joined #nim
03:00:15FromDiscord<libman> https://github.com/c-blake/cligen is nice. Had to fix a dozen nil comparisons and the like to get it working on latest nim. Too bad I can't submit changes due to git(hub)phobia.
03:03:50*cspar joined #nim
03:09:10*CcxWrk quit (Remote host closed the connection)
03:09:24*CcxWrk joined #nim
03:30:17*kapil___ joined #nim
03:32:57*Jesin joined #nim
03:36:46*nurupo19 joined #nim
03:39:35*nurupo19 quit (Remote host closed the connection)
03:46:06FromGitter<kaushalmodi> libman: The cligen author has already fixed that on the master HEAD last week. He just hasn't tagged a release. He's waiting for the next Nim release to be cut before tagging cligen.
03:47:01FromGitter<kaushalmodi> So just git clone the cligen repo, cd to it and nimble install.
03:51:50*Jesin quit (Quit: Leaving)
03:55:53*Jesin joined #nim
03:59:01*Jesin quit (Remote host closed the connection)
04:03:58FromGitter<kayabaNerve> Something from the last month broke my build... Aug 2nd's build is valid, Aug 31st's has a Table error. `lib/pure/collections/tables.nim(299, 7) Error: internal error: expr: param not init src_529637`
04:04:20*Jesin joined #nim
04:05:44FromGitter<kayabaNerve> Trying to get Koch output now...
04:06:38*dddddd quit (Remote host closed the connection)
04:20:57*stefanos82 joined #nim
04:24:35*PrimHelios quit (Quit: Leaving)
04:28:59FromGitter<kayabaNerve> Created a GitHub issue. It's weird as hell. I have no idea what caused it/what to do lol
04:59:20*nortoh1 joined #nim
05:04:05*nortoh1 quit (Remote host closed the connection)
05:15:33*nsf joined #nim
05:16:40*vivus quit (Remote host closed the connection)
05:39:08*kapil___ quit (Quit: Connection closed for inactivity)
05:48:51*vegax87 quit (Ping timeout: 260 seconds)
05:49:26*petersjt014[m] quit (Ping timeout: 260 seconds)
05:49:26*sg-james[m] quit (Ping timeout: 260 seconds)
05:49:37*RushPL quit (Remote host closed the connection)
05:49:49*sg-james[m] joined #nim
05:49:49*petersjt014[m] joined #nim
05:49:50*derlafff quit (Remote host closed the connection)
05:50:02*Miguelngel[m] quit (Ping timeout: 260 seconds)
05:50:02*Connor[m]1 quit (Ping timeout: 260 seconds)
05:50:02*macsek1911[m] quit (Ping timeout: 260 seconds)
05:50:02*sendell[m] quit (Ping timeout: 260 seconds)
05:50:02*gh0st[m] quit (Ping timeout: 260 seconds)
05:50:03*dyce[m] quit (Ping timeout: 260 seconds)
05:50:25*macsek1911[m] joined #nim
05:50:25*Connor[m]1 joined #nim
05:50:46*dyce[m] joined #nim
05:50:48*Miguelngel[m] joined #nim
05:50:48*sendell[m] joined #nim
05:50:53*RushPL joined #nim
05:50:56*derlafff joined #nim
05:50:58*gh0st[m] joined #nim
05:54:53*vegax87 joined #nim
06:07:14FromGitter<mratsim> @arnetheduck Exception and NewSeqOfCap are not exactly “new” :/
06:11:53*kapil___ joined #nim
06:12:22*skrylar quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
06:27:05*purrdeta6 joined #nim
06:29:02*purrdeta6 quit (Remote host closed the connection)
06:50:33yglukhov[m]Araq: pls ping me in closureiter issues in case i miss those
06:50:54yglukhov[m]or just assign them
06:51:32*cyraxjoe joined #nim
06:55:29FromGitter<codem4ster> Hi all, is there any way telling to net module's recv proc; try to take 4096 bytes but if you reach to the last byte of the current stream return what you get (or put it on my buffer). Socket would have 4 bytes buffered and waiting for an input. When I try to receive that 4 bytes with a 4096 byte buffer it hangs forever. If I give timeout to recv it throws an exception without getting data.
06:56:17*xet7 joined #nim
07:10:24Araqcodem4ster: dunno, I gave up on sockets programming a long time ago because of this :-)
07:11:08Araqthe OS refuses to get any size information. though to be fair, it wouldn't be reliable, I think
07:11:15Araq*to give
07:12:28*Vladar joined #nim
07:20:43*dadabidet joined #nim
07:34:03FromGitter<codem4ster> I made it work with unbuffered asyncsocket. But I will need to work this on threads. Are these {.async.} procs capable working in a thread. If so how? Just spawning them with threadpool?
07:36:55Araqdon't use the threadpool, it's unreliable
07:37:43FromGitter<mratsim> @codem4ster see here: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L39
07:37:51FromGitter<mratsim> but you can use CreateThread otherwise
07:39:10FromGitter<mratsim> you can mix and match async and multithreading, however nim doesn’t have M-N threading similar to goroutines (you can spawn M lightweight threads that will be multiplexed on N hardware threads)
07:53:25*fredrik92 is now known as couven92
08:03:42*gmpreussner_ joined #nim
08:03:52*gmpreussner quit (Ping timeout: 246 seconds)
08:19:07FromGitter<codem4ster> I'm getting semaphore timeout errors on windows (without threads).
08:19:42FromGitter<codem4ster> is this because of asyncdispatch?
08:21:42FromGitter<codem4ster> if I do this with net module, then I couldn't create a unbuffered socket.
08:21:58FromGitter<codem4ster> I'm totally lost now :(
08:23:15FromDiscord<2vg> codem4ster: Do you want to do something with a multithreaded TCP server?
08:24:47FromGitter<codem4ster> I'm trying to make a multithreaded socks5 proxy server.
08:25:27FromGitter<codem4ster> in nature socks5 proxies must be multithreaded already.
08:25:59FromDiscord<2vg> using asyncdispatch or asyncnet.
08:26:38FromGitter<codem4ster> I used them already. I'm getting semaphore timeout error.
08:27:00FromGitter<codem4ster> It works but sometimes it gives this error on windows.
08:27:08FromDiscord<2vg> semaphore timeout error...? wtf
08:27:13FromGitter<codem4ster> this is a windows specific error
08:27:53FromDiscord<2vg> oh
08:27:58FromGitter<codem4ster> https://answers.microsoft.com/en-us/windows/forum/windows_10-files-winpc/windows-10-error-message-the-semaphore-timeout/25c39ece-39f9-4326-b2ee-436bf52306d8
08:29:01FromGitter<codem4ster> I suspect this is because of async module
08:30:56FromDiscord<2vg> f*ckin windows :x
08:31:11TangerXD
08:31:48FromGitter<codem4ster> :D
08:32:15FromGitter<codem4ster> yeah F*ck it but I need this proxy server multiplatform :P
08:32:16FromGitter<mratsim> I love the screenshot on that thread
08:32:43FromGitter<mratsim> “Disney Film006 is not accessible. The semaphore timeout period has expired."
08:32:44FromGitter<codem4ster> at least I need it's clients multiplatform
08:33:18FromGitter<codem4ster> ahahah :D
08:33:44FromGitter<mratsim> Maybe try https://github.com/status-im/nim-asyncdispatch2, documentation is very sparse but we don’t have issue on windows in our projects
08:35:37FromGitter<codem4ster> I give up :)
08:35:54FromGitter<codem4ster> I spent 4 days
08:37:42FromGitter<codem4ster> Nim needs non-blocking sockets also use for this job.
08:38:20FromGitter<codem4ster> I could write this without async module.
08:39:26FromGitter<codem4ster> At least I can write in crystal, ruby, rust :(
08:39:39FromDiscord<2vg> can also use Selectros to create new asynchronous modules
08:49:56FromGitter<codem4ster> this is the working version with semaphore errors: https://paste.ofcode.org/8htc6JQcdvjWvAiJM4Qe2r
08:52:05FromGitter<codem4ster> may be you can tell smt to improve it
08:55:11FromGitter<codem4ster> you can test it by creating a socks5 proxy server on your firefox on to Port 90
08:55:43*Senketsu joined #nim
09:01:18*abm joined #nim
09:04:18*PMunch joined #nim
09:13:13*Senketsu quit (Quit: WeeChat 2.1)
09:15:52*Senketsu joined #nim
09:20:43FromGitter<dom96> If you're using threads maybe you should just use blocking sockets?
09:26:11FromGitter<mratsim> Does Crystal work in Windows?
09:28:11FromGitter<narimiran> @mratsim i've seen your mention of nim in the 'speed up python with rust' reddit post, so i did a quick comparision. hopefully we won't get downvoted for "nim brigading" or whatever it is called usually :)
09:28:39FromGitter<mratsim> my comparison is that there is only little overhead ;)
09:29:21FromGitter<narimiran> i didn't write it explicitly, but i hope people will see how nim's syntax is much simpler and more familiar to python users
09:29:28livcdmratsim: crystal does not work on windows atm
09:30:43*ftsf quit (Quit: Leaving)
09:31:47*seni joined #nim
09:32:44livcdcodem4ster: how do i trigger the error ?
09:36:15*ven473 quit (Quit: ven473)
09:37:20livcdcodem4ster: i compiled it with c -d:release and ran it, then socks5 localhost:90
09:55:21*dadabidet quit (Quit: Leaving)
09:56:56*dddddd joined #nim
09:57:07FromGitter<mratsim> @livcd, on windows?
10:20:13FromGitter<codem4ster> @mratsim not for now. But work in progress.
10:20:52FromGitter<codem4ster> @livcd you must be on windows and try to use proxy a bit
10:21:16FromGitter<codem4ster> it gives error on 3rd or 4th site you open
10:22:09*Senketsu quit (Quit: WeeChat 2.2)
10:22:15FromGitter<codem4ster> I must say without a powerful socket api, Nim cannot go further in the arena. :(
10:22:41FromGitter<codem4ster> socket is the mother of all web things.
10:24:27*Senketsu joined #nim
10:25:42FromGitter<codem4ster> @mratsim if crystal support parallelism and windows it will become a must know multipurpose language.
10:26:39FromGitter<codem4ster> and I think it needs a faster GC
10:27:30FromGitter<codem4ster> on the Nim side I fell in love with compile capabilities, speed and syntax
10:27:31FromGitter<mratsim> I’m not too sure what’s happening between https://github.com/crystal-lang/crystal/projects/6 and https://github.com/crystal-lang/crystal/issues/5430
10:28:30FromGitter<mratsim> Seems like they are at the Fiber stage which might trigger semaphores issues as well (or was it threads?)
10:28:52FromGitter<codem4ster> fibers aren't threads
10:29:22FromGitter<mratsim> they are lightweight userland threads, similar to coroutines/green threads
10:29:53FromGitter<codem4ster> it works in single core like async
10:30:03FromGitter<mratsim> those are still threads
10:30:16FromGitter<mratsim> you can have multiple threads on a single core
10:30:44FromGitter<mratsim> async is doing multiple threads on a single core
10:31:00FromGitter<codem4ster> not exactly, it uses scheduler, you don't have visible threads in crystal
10:31:19FromGitter<mratsim> multithreading as used nowadays is w.r.t. to hardware kernel scheduled threads
10:31:29FromGitter<codem4ster> oh ok then :)
10:31:42*LuK13377 joined #nim
10:31:58FromGitter<codem4ster> I'm always looking for multicore threads :P
10:32:14FromGitter<mratsim> but coroutines/fibers/green threading is also thread even though it’s software
10:32:24FromGitter<codem4ster> ok I got it
10:32:45FromGitter<mratsim> well if you really want to go into this rabbit hole just have a look there: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources
10:32:47FromGitter<vivekimsit> ok, I am very new and all these aync, coroutines etc are scaring me :)
10:33:18FromGitter<vivekimsit> any good resource to understand these things in depth?
10:33:25FromGitter<mratsim> For itnerpreter optimization you have various threading techniques (indirect threading, direct threading, call threading, switch threading)
10:33:44FromGitter<mratsim> but those are not about multithreading or even async/coroutines
10:34:06FromGitter<mratsim> but that was what threading meant 20 years ago
10:34:39FromGitter<mratsim> @vivekimsit you can use any Python or C# tutorial on async/await to understand Nim implementation
10:34:59FromGitter<codem4ster> I just want to use my cpu's full power :) Not interested in technical details. These days Nim can do this but Crystal cannot.
10:35:42FromGitter<codem4ster> I'm not a language designer although nor I'm not qualified to write a threading low level code :(
10:35:43FromGitter<vivekimsit> ok, but I am more into JS nowadays
10:36:15FromGitter<mratsim> Look into JS Promises then, they are equivalent to Nim Future’s AFAIK
10:36:23*LuK13377 quit (Remote host closed the connection)
10:36:35FromGitter<codem4ster> NodeJS also hasn't support for parallelism
10:37:47FromGitter<mratsim> @vivekimsit maybe that will help: https://translate.google.com/translate?hl=en&sl=fr&tl=en&u=https%3A%2F%2Fblog.xebia.fr%2F2017%2F11%2F14%2Fasyncawait-une-meilleure-facon-de-faire-de-lasynchronisme-en-javascript%2F
10:38:34FromGitter<vivekimsit> @mratsim thanks will check that for sure
10:38:55FromGitter<mratsim> @codem4ster: `for i in 0||100: foo()` <— OpenMP parallel loop using all your cores
10:39:31FromGitter<mratsim> just make sure to not allocate inside the loop (push/pop stackTraces: off) as well
10:39:32FromGitter<codem4ster> @vivekimsit that was old news. NodeJS now can support parallelism as this post: https://stackoverflow.com/questions/39584439/does-node-js-support-parallelism
10:39:33FromGitter<vivekimsit> also, if anyone is writing libraries for Nim, please do let me know. I want to contribute as much as I can but reading only docs can be a bit boring
10:39:46FromGitter<vivekimsit> @codem4ster nice
10:40:44FromGitter<codem4ster> I hear OpenMP but didn't use before
10:41:18FromGitter<alehander42> @vivekimsit you can always take a look at https://github.com/nim-lang/needed-libraries
10:41:27FromGitter<alehander42> what kind of libs would you like to work on?
10:43:41FromGitter<vivekimsit> @alehander42 in the long run I would like to have a good testing library like: ⏎ https://github.com/avajs/ava
10:43:59FromGitter<vivekimsit> but I can start with some small tasks first
10:44:13FromGitter<vivekimsit> let me have a look at link you sent
10:46:09FromGitter<alehander42> look at the issues in that repo
10:46:52FromGitter<vivekimsit> sure, thanks
10:47:04FromGitter<alehander42> testing libs are always welcome, I maintain quicktest, but it's specialized in property testing and based on `unittest`
10:47:53FromGitter<vivekimsit> yes, I think lot of people need a good testing library, you can see how popular that library got within few months of release
10:47:53FromGitter<matrixbot> `ehmry` vivek poddar (Gitter): the blake2 package is broken for me with nim/devel, it needs some type fixes in proc signatures
10:47:54FromGitter<narimiran> @mratsim does that `for i in 0||100` work out of the box? are some compile flags needed? i've seen a mention of `||` maybe a year ago, but i have never seen it "in the wild"
10:48:20FromGitter<mratsim> it’s everywhere in Arraymancer
10:49:06FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/openmp.nim#L40
10:49:19FromGitter<matrixbot> `ehmry` vivek poddar (Gitter): also, SHAKE256 in nimcrypto needs tests for hashes of uncommon lengths
10:49:40FromGitter<mratsim> https://github.com/mratsim/Arraymancer/blob/master/src/nn_primitives/fallback/conv.nim#L40
10:53:32*krux02 joined #nim
10:55:21*r4vi quit ()
10:55:35*r4vi joined #nim
10:57:19livcdcodem4ster: i left it open and was browsing around and did not hit any issues
10:57:38FromGitter<narimiran> thanks for the example, will try to write some of my own to see if/how it works
10:58:20*Yardanico quit (Quit: Quitting)
11:02:29*Yardanico joined #nim
11:05:46*zachcarter quit (Ping timeout: 272 seconds)
11:06:26*Senketsu quit (Quit: WeeChat 2.2)
11:07:05*xeroks10 joined #nim
11:07:17FromGitter<matrixbot> `ehmry` anyone know of an easy way for nimble tasks to introspect the package name?
11:08:58*Senketsu joined #nim
11:09:29*Senketsu quit (Client Quit)
11:10:03FromGitter<narimiran> hmmm, i've tried a simple example of naive prime finding, and i get no difference between `..` and `||` version out of the box
11:10:08*xeroks10 quit (Read error: Connection reset by peer)
11:12:37*Senketsu joined #nim
11:14:42*rokups joined #nim
11:20:14FromGitter<mratsim> @narimiran there are dependencies for primes, I tried and it didn’t help for a basic sieve of Erathostenes
11:20:55FromGitter<mratsim> you might even have false sharing/cache invalidation
11:22:08FromGitter<narimiran> it uses only one core!?
11:22:34FromGitter<narimiran> now i've created a version with `parallel` and `spawn` which uses all cores and it is noticeably faster
11:23:08FromGitter<mratsim> no it should use all cores
11:27:42FromGitter<codem4ster> @livcd what is your operating system is that <windows10? This issue is on windows 10
11:27:50*pwntus joined #nim
11:32:56FromGitter<mratsim> Tried to configure stuff in Windows 10 the past weekend, I got "The application has failed to start because the side by side configuration is incorrect please see the application event log or use the command line sxstrace.exe tool for more detail.” all over the place. ⏎ ⏎ Plenty of websites including Microsoft’s recommended to reinstall Visual C++. I tried to run the installer, and guess what "The application
11:32:56FromGitter... has failed to start because the side by side configuration is incorrect please see the application event log or use the command line sxstrace.exe tool for more detail.” on Visual C++ installer ...
11:36:03*pwntus quit (Changing host)
11:36:03*pwntus joined #nim
11:44:57livcdcodem4ster: yes w10
12:06:39FromGitter<codem4ster> are you using devel version of nim?
12:06:45FromGitter<codem4ster> or 0.18.0
12:16:53livcdNim Compiler Version 0.18.1
12:21:05FromGitter<codem4ster> did you compile from source, cannot find the binary.
12:22:48livcdyes!
12:23:18FromGitter<codem4ster> ah got it
12:23:32FromGitter<codem4ster> I will try the code with 0.18.1
12:37:06FromGitter<codem4ster> I stuck at this: cd csources && sh build.sh # or .bat for Windows in csources
12:37:37FromGitter<codem4ster> cd csources && sh build.bat ⏎ 'sh' is not recognized as an internal or external command, ⏎ operable program or batch file.
12:37:44FromGitter<codem4ster> ahh
12:37:48FromGitter<codem4ster> my mistake sorry
12:37:57shashlicksh is Linux
12:38:14FromGitter<codem4ster> I didn't see that in front of build.bat
12:43:31FromGitter<codem4ster> I'm getting this: ⏎ ⏎ `````` [https://gitter.im/nim-lang/Nim?at=5b8e7df3d8d36815e5d4f49c]
12:45:01FromGitter<codem4ster> I'm getting this ⏎ ⏎ ```gcc version 6.3.0 (x86_64-win32-seh-rev1, Built by MinGW-W64 project)``` [https://gitter.im/nim-lang/Nim?at=5b8e7e4d94f8164c17db84bb]
12:47:16*ven473 joined #nim
12:47:51shashlickUse build64.bat
12:49:05FromGitter<codem4ster> thanks it started compiling now
12:49:37shashlickAre you using head
12:59:56*noonien joined #nim
13:04:32FromGitter<codem4ster> I compiled successfully. Thanks for help.
13:04:53FromGitter<codem4ster> and in this version it seems working correctly.
13:14:13*endragor quit (Remote host closed the connection)
13:16:58*zacharycarter joined #nim
13:21:39*arecaceae quit (Remote host closed the connection)
13:21:57*arecaceae joined #nim
13:24:46zacharycarterblah - I don't want to do work today (fixing bugs in our Jenkins pipeline) - I want to work more on the ES6 class macro I started last night :(
13:28:23*cspar quit (Ping timeout: 245 seconds)
13:45:47FromGitter<mratsim> @codem4ster so no semaphores issue anymore?
13:49:40FromGitter<mratsim> 5399 stars in the repo
13:51:27*abm quit (Ping timeout: 240 seconds)
13:52:23*dadabidet joined #nim
13:56:56zacharycarterpretty good!~
13:57:07*cspar joined #nim
13:58:29FromGitter<narimiran> and i'm the 5400th :)
13:58:55FromGitter<narimiran> (don't know how/why i didn't star it before)
14:03:44zacharycarteryay! :D
14:10:37*abm joined #nim
14:14:29FromGitter<codem4ster> yes @mratsim no semaphore issues
14:15:11FromGitter<mratsim> cool
14:28:38zacharycarterhttps://eli.thegreenplace.net/2018/measuring-context-switching-and-memory-overheads-for-linux-threads/
14:30:32*dadabidet left #nim ("Leaving")
15:04:16*rokups quit (Quit: Connection closed for inactivity)
15:12:37*brainpro1 quit (Ping timeout: 246 seconds)
15:20:16*PMunch quit (Quit: Leaving)
15:22:41FromGitter<Bennyelg> hello friends how I can do something like this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8ea341c9500b4bab7fab54]
15:22:48FromGitter<Bennyelg> but return true false
15:23:00FromGitter<Bennyelg> if the function successed and false otherwise
15:24:00leorize`try: do something; result = true; except: result = false`?
15:25:21FromGitter<Bennyelg> thanks
15:35:05*endragor joined #nim
15:39:08*kapil___ quit (Quit: Connection closed for inactivity)
15:44:26*Trustable joined #nim
15:44:49*endragor quit (Remote host closed the connection)
16:03:30*flyx joined #nim
16:25:52*PrimHelios joined #nim
16:27:38*nsf quit (Quit: WeeChat 2.2)
16:30:51FromGitter<mratsim> Exceptions should be use for exceptional stuff, not for control flow.
16:39:35*Trustable quit (Remote host closed the connection)
16:49:08*cyraxjoe quit (Quit: I'm out!)
16:49:28*cyraxjoe joined #nim
16:57:25*brainpro1 joined #nim
17:08:41*PrimHelios quit (Remote host closed the connection)
17:09:01*PrimHelios joined #nim
17:13:41*PrimHelios quit (Remote host closed the connection)
17:14:31*PrimHelios joined #nim
17:18:11zacharycarterLove hearing co-workers discuss what version of NPM they're using because their Node project is broken
17:18:21zacharycartervery happy we don't have that issue w/ Nimble
17:20:01*TheLemonMan joined #nim
17:24:11*PrimHelios quit (Remote host closed the connection)
17:25:14*PrimHelios joined #nim
17:26:11*PrimHelios quit (Remote host closed the connection)
17:27:41*PrimHelios joined #nim
17:40:22*brainpro1 quit (Ping timeout: 244 seconds)
17:41:50*brainpro1 joined #nim
17:42:41*PrimHelios quit (Remote host closed the connection)
17:43:55*PrimHelios joined #nim
17:53:56*zacharycarter quit (Quit: Page closed)
17:56:09FromGitter<ephja> good old node_modules directory
17:56:45*PrimHelios quit (Quit: Leaving)
17:57:44*PMunch joined #nim
18:03:18*zacharycarter joined #nim
18:26:07*cspar quit (Ping timeout: 240 seconds)
18:27:45FromGitter<kayabaNerve> I have an idea
18:27:58FromGitter<kayabaNerve> Why don't we write code so the Nim compiler never crashes
18:28:14FromGitter<kayabaNerve> Or just write in the main function
18:28:19FromGitter<kayabaNerve> #Plz don't crash
18:28:36FromGitter<kayabaNerve> I think I solved Nim 🤔 and every program every
18:29:51Araqalmost. You also need more emojis.
18:29:58FromGitter<kayabaNerve> 🤔🤔🤔🤔
18:30:30TheLemonManless snark and more test cases
18:30:38stefanos82personally I don't see any emojis with hexchat
18:30:46stefanos82unless they are UTF-8
18:31:05FromGitter<kayabaNerve> :P Nah. Most of the time, it's my fault (I once tried using files with standard public functions in [T]). It actually made it past what the compiler checks and caused a crash...
18:31:17FromGitter<kayabaNerve> stefanos82: :thinking: :thinking: :thinking:
18:31:36Araqmore test cases? I think we have plenty.
18:31:43FromGitter<kayabaNerve> Neither Gitter not IRC show those but you can understand it.
18:32:02Araqthe fact that they are never good enough hints to me that the language is too complex
18:32:07stefanos82@kayabaNerve: lol think as much as you like, but IRC does not interprets Gitter's emojis
18:32:24FromGitter<kayabaNerve> That doesn't even work with Gitter though
18:32:31FromGitter<kayabaNerve> (the :thinking:)
18:32:51*nsf joined #nim
18:32:53stefanos82it doesn't matter; it's the effort that counts ;)
18:32:57FromGitter<kayabaNerve> Well, last I checked (60 days ago), you can use files as variables without causing a Nim error yet while still causing a crash
18:33:24FromGitter<rayman22201> https://www.emojicode.org/ 😝
18:33:56FromGitter<rayman22201> Sorry guys. Nim isn't good enough. I'm moving to emojicode
18:34:23FromGitter<kayabaNerve> @rayman22201 I hear it's actually a decent language if you ignore the annoyance of emoojis
18:39:50FromGitter<kayabaNerve> Can I not select a commit using choosenim? :(
18:40:07zacharycarterquestion - does anyone know a good way to benchmark HTML page rendering speeds?
18:40:25zacharycarterI want to benchmark an example using the library I ported over the weekend vs react
18:41:10FromGitter<Vindaar> Hey guys! I'm trying to write a macro, which takes a proc as an argument and creates a modified version of it. Using `.getImpl.body` I get the AST alright. So I replace the symbols by new idents. Problem is that generic calls, e.g. `newSeq[int]` are already resolved, so the AST I get isn't valid without the symbols. How do I deal with this?
18:41:22FromGitter<Bennyelg> anyway to acquire index when mapIt ?
18:41:42Araqno, use a for loop.
18:41:53FromGitter<Bennyelg> thanks
18:41:57*cspar joined #nim
18:41:58AraqVindaar: use 'untyped' for the macro parameter's type
18:42:23FromGitter<Vindaar> But how do I get the proc body then?
18:42:24Araqzacharycarter, honestly, who cares.
18:42:53zacharycarterAraq: all the stupid people who worry about SEO at my company
18:42:56Araqnobody will notice it either way unless you re-render too much
18:43:27zacharycarterI get that but I'm trying to prove a point to co-workers that tagged template literals and direct dom manipulation are going to be speedier than react and VDOM
18:43:35senican nimgen be used for C++11 ?
18:44:01Araqyeah, SEO, right. just provide good content/ a useful app.
18:44:06zacharycarterco-workers don't like to listen / regard my suggestions so I have to have demonstrable evidence to convince them
18:44:30zacharycarterI don't disagree with you - but the amount of time that gets spent optimizing react apps is something I'd like to not have to spend when our app's turn comes
18:45:05zacharycarterone of our teams spent several months on optimizations for the crawling changes Google made a few months back
18:45:12Araqa VDOM is indeed not fast, it's used for productivity.
18:45:14zacharycarterI don't want to have to do that
18:45:45zacharycarterwell - I'm just trying to prove to co-workers - that you don't need to use a framework like react in every frontend web project
18:45:49Araqthe point is to ensure by construction that your UI state is not out of sync with your app's state
18:46:07zacharycarterthat you can get by with a small library and a sane method for handling state
18:46:10Araqand you do that by nuking the UI state.
18:46:34Araqand that's it. Using a VDOM lib for "speed" is stupid.
18:47:41zacharycarterwell the company switched to react because they were using Angular one and Angular two was still in beta
18:48:11*brainpro1 quit (Ping timeout: 260 seconds)
18:48:12zacharycarternow they've built a UI component library using React - and it's been enforced lately that every project needs to use this library and thusly React
18:48:56zacharycarterbut we're pulling down 1.14mb of JS with our app
18:49:01Araqoh yeah, I forgot, React doesn't understand its own ideas.
18:49:25Araq"components" are against the VDOM ideas.
18:50:23zacharycarterwell - all I know is - I don't want to be asked to spend months "optimizing" for SEO because I'm using react and the crawler can't deal with that fact / our JS bundle is over a meg in size
18:51:41FromGitter<kayabaNerve> So I found where my crash is happening
18:51:59FromGitter<kayabaNerve> It's happening at least before a compiler update on August 10th
18:52:30FromGitter<kayabaNerve> The very commit I tested is the one that changed the exception system
18:52:42FromGitter<kayabaNerve> Araq Why did you have to go and improve Nim? You broke my code :(
19:17:30seniso I take it nimgen does not work with C++11 ?
19:20:10FromGitter<Araq> C++11 is Ok'ish
19:20:26FromGitter<Araq> better update c2nim to understand move semantics though
19:25:43*justsomequestion joined #nim
19:28:57*brainpro1 joined #nim
19:30:19FromGitter<Vindaar> @Araq when using `untyped`, I guess I'll have to hand the whole proc implementation as the argument to the macro, no? So there's no way to just hand the proc name and use `bindSym` to get the actual implementation?
19:34:36*zacharycarter quit (Ping timeout: 252 seconds)
19:47:21stefanos82@Araq: C++11 is really cool, but C++14 got cooler and C++17 so far has been even cooler lol. Now, C++20 features are also going to simplify lots of metaprogramming libraries, thanks to Concepts and hopefully modules
19:50:49*anzuof3 joined #nim
19:53:43*anzuof3 quit (Remote host closed the connection)
19:54:37FromGitter<Bennyelg> using regex to take only the characters from a string.
19:54:45FromGitter<Bennyelg> the opposite of replace
20:00:03*justsomequestion quit (Ping timeout: 245 seconds)
20:02:47*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
20:02:56*kungtotte quit (Remote host closed the connection)
20:08:48FromGitter<tim-st> the following crashes, shouldnt this work? `import uri; echo decodeUrl("%")`
20:21:55FromGitter<Bennyelg> getting annoying ``` index out of bounds [IndexError]``` when executing insert to sqlite but when taking the query generated and insert it directly its working
20:22:05FromGitter<Bennyelg> donnu where to look
20:25:21krux02I never did Nim in web programming, what is the overhead? How big is it to make the frontend in Nim?
20:26:10krux02Is it a lazy code generator that only generates what is necessary, or is there a big blob of code that code needs in order to run Nim generated javascript?
20:27:23krux02I recently saw a talk about a guy who wanted to do web development in python and he showed the different alternatives and how big the overhead is.
20:29:01FromDiscord<has1> hi all
20:31:11krux02hi has1
20:34:27krux02I found it out, hello world in Nim generates 2244 byts javascript
20:35:38FromDiscord<has1> 2KB??
20:35:46krux02yes
20:35:57krux02could still be minified
20:36:01krux02I guess that is ok
20:36:41FromDiscord<has1> "Compiles to C, C++ or JavaScript" is this a new feature? compile to js?
20:36:50FromDiscord<has1> i dont know if i saw that before
20:36:57krux02no it is not new
20:37:44FromDiscord<has1> how viable is this? And will it be able to compile to wasm?
20:37:55FromDiscord<has1> and how is this so small if it has a Garbage collector?
20:38:52krux02there is no wasm support at the moment, but there is also no reason why the generated C code from Nim can't be compiled to wasm
20:39:10krux02the toolchain just hasn't been built
20:42:49FromDiscord<has1> does nim have generics?
20:44:17FromDiscord<Generic> yes and imho one of the best generics of all modern programming languages
20:45:19FromDiscord<has1> could you point me to it? i cant see it in the docs
20:45:59FromDiscord<Generic> https://nim-lang.org/docs/manual.html#generics
20:49:42*cyraxjoe quit (Remote host closed the connection)
20:50:28*nsf quit (Quit: WeeChat 2.2)
20:51:26FromDiscord<has1> thank you
21:00:09*cyraxjoe joined #nim
21:06:45FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8ef3e5cff55e5617a9a469]
21:07:14FromGitter<Bennyelg> going nuts , running it directly from sqlite works when execute it with nim, i got the index out of bound error
21:07:19FromGitter<Bennyelg> this is unbelivable
21:08:31FromGitter<Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b8ef44ff86b741b050cfd2b]
21:11:57FromGitter<alehander42> ok, what happens in dbFormat? it tells you where the error is
21:22:08*seni quit (Quit: Leaving)
21:23:27*arecaceae quit (Remote host closed the connection)
21:23:46*arecaceae joined #nim
21:29:41FromGitter<Bennyelg> this is line 120 in the db format
21:29:42FromGitter<Bennyelg> add(result, dbQuote(args[a]))
21:29:49FromGitter<Bennyelg> but it don't tell me sh1t
21:30:04FromGitter<Bennyelg> because I am not adding any args
21:31:05FromGitter<Bennyelg> done! thank you ALEXANDER
21:31:08*endragor joined #nim
21:31:14FromGitter<Bennyelg> I had a freaking `?` in my code.
21:31:25*MyMind quit (Quit: WeeChat 2.3-dev)
21:33:47*stefanos82 quit (Quit: Quitting for now...)
21:34:39*Sembei joined #nim
21:35:19FromGitter<alehander42> ahh, isn't is escaped somehow
21:35:27*endragor quit (Ping timeout: 252 seconds)
21:35:31FromGitter<alehander42> i see, frustrating haha
21:35:34FromGitter<alehander42> good
21:41:07*cspar quit (Ping timeout: 246 seconds)
22:02:55FromGitter<mratsim> @Vindaar welcome to macro + generics, you can find my rants there: https://github.com/nim-lang/Nim/issues/8677, https://github.com/nim-lang/Nim/issues/7719
22:03:58FromGitter<mratsim> This might help you avoid certain pitfalls in macro + generics: https://github.com/numforge/loop-fusion
22:04:39FromGitter<mratsim> and remember, mixin and bindSym might be your friends
22:11:09FromGitter<Vindaar> Ah, @mratsim thanks! #7719 I found earlier today and was helpful. #8677 I saw when you opened it 2 weeks ago, it didn't pop up in my search today. Need some time to digest it
22:13:37FromGitter<Vindaar> And `bindSym` I thought would allow me to do what I wanted, but it just tells me it can't evaluate my `untyped` parameter at compile time :|
22:13:52FromGitter<Vindaar> `mixin` I still don't quite know what it actually does
22:20:36FromGitter<mratsim> mixin tells the compiler, consider this symbol open for now, I will do magic (or you will find it) later
22:26:30FromGitter<Vindaar> Hmm, thanks. I keep reading the manual entry about open and closed symbol, but I haven't quite grasped it yet
22:28:09FromGitter<mratsim> open symbol: visible, closed: undeclared identifier/routine
22:28:33FromGitter<mratsim> with generics, Nim tries to resolve openness early
22:28:57FromGitter<Vindaar> oh, I see
22:29:02FromGitter<mratsim> which causes issue in untyped macro that are supposed to modify the AST earlier than anything else
22:29:21FromGitter<mratsim> when you have generics, the generics pass is done before your AST manipulation
22:30:07FromGitter<Vindaar> which obviously breaks modifying generics properly with macros, makes sense
22:30:17FromGitter<mratsim> An example is this: https://github.com/nim-lang/Nim/issues/6387
22:30:43FromGitter<mratsim> following that I had to do declare `const _* = Foo()`
22:30:53FromGitter<mratsim> so that there was a visible _ symbol
22:31:14FromGitter<mratsim> I couldn’t replace it in the `[]` macro
22:31:31FromGitter<mratsim> well it works for normal proc but not if the macro was used in generic procs
22:34:18FromGitter<Vindaar> interesting, that helps explain it!
22:38:32*brainproxy joined #nim
22:39:00*brainpro1 quit (Ping timeout: 244 seconds)
22:40:59FromGitter<Vindaar> ok, off to bed. Good night :)
22:42:09*smt` joined #nim
22:42:18*PMunch quit (Remote host closed the connection)
22:45:53*smt quit (Ping timeout: 245 seconds)
22:47:16FromGitter<zetashift> gnight
23:06:08*zachcarter joined #nim
23:34:59*xet7 quit (Quit: Leaving)
23:41:46*noonien quit (Quit: Connection closed for inactivity)
23:42:41*mww113 joined #nim
23:47:30*krux02 quit (Remote host closed the connection)
23:47:39*mww113 quit (Read error: Connection reset by peer)
23:53:38AlexMaxzachcarter: Do you intend to update the nuklear submodule
23:53:47AlexMaxin your nuklear bindings?