<< 25-10-2017 >>

00:07:44FromGitter<Varriount> dom96: It may not be possible to statically link to a DLL, however it is possible to load a DLL from memory at runtime.
00:08:10*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
00:35:11*dhalinar2 joined #nim
00:43:12*NimBot joined #nim
00:47:42*wyldcraft joined #nim
00:48:25wyldcrafti've spent a while trying to figure out what next language to adopt seriously and nim is looking good
01:01:19*dddddd quit (Remote host closed the connection)
01:02:38FromGitter<Varriount> We need more library developers. :3
01:10:34hogelandjust bought nim in action, looking forward to reading it
01:16:37*ipjk quit (Read error: Connection reset by peer)
01:20:08*adeohluwa quit (Quit: Connection closed for inactivity)
01:28:57wyldcrafti'm interested in supporting nim on amazon lambda
01:29:16wyldcraftone of the 100ms-at-a-time serverless providers
01:39:45*dhalinar2 quit (Ping timeout: 248 seconds)
01:54:31FromGitter<Varriount> wyldcraft: I believe @zacharycarter got Nim running on Lambda
02:01:55wyldcraftseems straightforward with js compile target
02:02:03wyldcrafthey who wants to make a startup
02:02:14wyldcrafti just had a "location change" lay-off from my job
02:02:28wyldcrafti'm full stack linux and android (and ios meh)
02:02:48wyldcraftwith a pile of startup experience
02:19:09*wyldcraft quit (Ping timeout: 260 seconds)
02:48:46*martinium joined #nim
02:51:14*rauss joined #nim
02:56:38*vlad1777d quit (Ping timeout: 258 seconds)
03:03:55GitDisc<treeform> making a startup is really hard
03:09:12*vlad1777d joined #nim
03:14:09*vlad1777d quit (Ping timeout: 248 seconds)
03:14:36*vlad1777d joined #nim
03:29:16FromGitter<Varriount> treeform: You mean a company?
03:29:25*arecaceae quit (Remote host closed the connection)
03:29:43*arecaceae joined #nim
03:30:22*vlad1777d quit (Ping timeout: 258 seconds)
03:36:54*vlad1777d joined #nim
03:54:39*vlad1777d quit (Ping timeout: 248 seconds)
03:57:08*exit70 joined #nim
04:01:53*vlad1777d joined #nim
04:08:33*vlad1777d quit (Ping timeout: 248 seconds)
04:21:29*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:27:19*martinium joined #nim
04:30:53captainkraftThe Nuklear bindings I'm trying to use have {.compile: "src/bind.c".} at the top, but when I try to build, it says the .o file is not found. What could cause this .o file to fail to be generated and should the nim compiler tell me about that?
04:52:13captainkraftMaybe that compile pragma isn't needed at all?
04:58:37*martinium quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:59:54*vlad1777d joined #nim
05:11:59FromGitter<Gooseus> So I've been messing around with Nim for the last week or so after seeing it pop up on the radar a few times and it's been a ton of fun. I got my feet wet with a simple cli app and have moved on to attempting a simple async S3 client, where I've run into questions regarding the async dispatch / event loop stuff.
05:16:16FromGitter<Gooseus> I feel pretty in over my head when it comes to the low-level GC stuff and the higher-level meta-programming template/macro stuff... I'm coming from Javascript land where that is pretty foreign, but async http requests are bread and butter, though we don't have much control over our event loop.
05:16:37FromGitter<Gooseus> https://gist.github.com/Gooseus/240f534fb6277ef13fcd48a579b9edae
05:21:05FromGitter<Gooseus> so my question is related to line 33 in that gist: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f01f41210ac269202a127e]
05:24:12FromGitter<Gooseus> I did some casual a/b testing downloading 100 5mb files from localhost with/without and it seemed like including that initial polling had some improvements, while also seeming to make more sense as an async request mechanism. Am I missing something about how async works here or how it should best be handled at this level? Sorry for the wall of text here
05:25:10*miran_ joined #nim
05:28:10*gooseus__ joined #nim
05:28:52*gooseus__ quit (Client Quit)
05:41:08FromGitter<Varriount> @Gooseus Just a heads up, the channel gets fairly quiet at this time.
05:42:20FromGitter<Gooseus> np, I assume there aren't a lot of people on the west coast here?
05:43:21FromGitter<Varriount> I guess. I'm on the east coast.
05:43:32*craigger quit (Ping timeout: 260 seconds)
05:43:32FromGitter<Varriount> We have developers in Europe too
05:45:04*Vladar joined #nim
05:45:35*craigger joined #nim
05:46:01FromGitter<Gooseus> cool cool, I'm patient, I'll just keep messing around and hope for some feedback in the morning
05:47:15FromGitter<Varriount> @Gooseus Your program is somewhat differently structured.
05:47:58FromGitter<Varriount> I would normally expect everything, including the logic that adds files, to all be part of the coroutine layout
05:50:02FromGitter<Varriount> You would have a bunch of coroutines that are launched, passing a filename to each. Those would then download the file and write it out.
05:50:16FromGitter<Gooseus> @Varriount I'm not familiar with this... any examples laying around? I am kind of just writing like I'm working with a scripting language to see how everything works
05:51:52FromGitter<Gooseus> how would the coroutines work differently? would that involve some parallelism with additional threads or does that change how the event loop operates?
05:51:53FromGitter<Varriount> Hrm, no examples off hand, unless I write some pseudocode
06:02:17FromGitter<Varriount> @Gooseus Something like this: https://gist.github.com/Varriount/e8f0f4fb02d8596b7caa2596c66ffc62
06:02:28FromGitter<Varriount> Note that I haven't tested it.
06:06:35FromGitter<Varriount> Ah, you need to add poll at the logic near the end
06:06:57FromGitter<Gooseus> ok, I see how that is different, but it mostly differs with how the file output is written, no?
06:08:53FromGitter<Varriount> The idea is to put the action of writing the file inside the coroutine
06:10:56FromGitter<Varriount> It's also tricky, calling poll() inside a coroutine. I don't know if the async framework is reentrant.
06:12:47shodan45s3 + nim? is there a lib for that?
06:12:55FromGitter<Gooseus> so is the coroutine a part of the C that is compiled using your pattern?
06:13:59FromGitter<Gooseus> shodan45 there might be, I'm just playing around... though I have heard a lot of talk about a lack of AWS library
06:14:24FromGitter<Varriount> Well, it's all compiled to C
06:14:40FromGitter<Gooseus> ``` Error No package found.``````
06:15:07FromGitter<Varriount> Internally, the coroutine is transformed into an iterator, which is then transformed into a regular C function
06:15:28*miran_ quit (Ping timeout: 248 seconds)
06:16:46FromGitter<Gooseus> but your code doesn't change the order in which the connections to the server are established? I'm still trying to get your version working
06:17:27FromGitter<Varriount> Well, with my version, the order will be somewhat unpredictable.
06:17:56FromGitter<Varriount> Technically it should be same order they were started in.
06:18:16FromGitter<Varriount> What problem are you encountering?
06:21:11FromGitter<Varriount> @Gooseus ^
06:21:56FromGitter<Gooseus> not really encountering problems, just trying to understand how it's working with regards to the the async/await stuff... I just noticed that when I was trying to grab multiple files asynchronously that the connections would still be made in order because of how I was using await and waitFor
06:23:06FromGitter<Gooseus> the error in your version is `core_v.nim(37, 13) Error: type mismatch: got (AsyncFile, Future[system.string])` for `await file.write(data)`
06:23:26couven92@Varriount, I guess you could even say that *most* people here in the channel are from Europe (and some from the closer parts of Russia), no? At least that is the impression I get from the IP shown in IRC...
06:26:08FromGitter<Gooseus> hmmm... worked when I changed it to `await file.write(await data)` which I guess makes sense
06:31:39FromGitter<Varriount> I don't know if 'waitFor' runs the other coroutines too.
06:31:59FromGitter<Varriount> @dom96 Is there a wait to wait on multiple coroutines at once?
06:35:42*Arrrr joined #nim
06:35:42*Arrrr quit (Changing host)
06:35:42*Arrrr joined #nim
06:36:10*nsf joined #nim
06:38:56Arrrrhttps://github.com/nim-lang/nimforum/pull/111
06:39:03ArrrrNim is the bleeding edge
06:57:05*shodan45 applies a bandage
06:57:24FromGitter<mratsim> @captainkraft, {.compile.} path is relative to the caller module not the project root
07:01:19*jkhl joined #nim
07:25:26*claudiuinberlin joined #nim
07:28:48*Viktor joined #nim
07:45:26FromGitter<Gooseus> @Varriount so my understanding from playing around and poking in the asyncdispatch source is that `waitFor` does `while not fut.finished: poll()` so you'd probably need to construct a future which completes when the every future in a set is finished and then waitFor that one?
07:45:31*Andris_zbx joined #nim
07:50:29*PMunch joined #nim
07:53:35*jkhl quit (Ping timeout: 248 seconds)
07:57:49*adeohluwa joined #nim
08:03:13*fredrik92 joined #nim
08:13:04*couven92 quit (Disconnected by services)
08:13:15*fredrik92 is now known as couven92
08:13:30*fredrik92 joined #nim
08:25:11adeohluwasay you have a node. js app on a server, all things bn equal you can handle a lot more users by just switching to nim lang right?
08:26:30PMunchadeohluwa, theoretically yes. But node developers have put a lot of time and effort into improving nodes web performance. So I wouldn't be suprised if they were hard to beat IRL
08:27:10adeohluwahmm... okay thanks
08:28:00PMunchHmm, parsing the ndi information is proving harder than I had hope..
08:28:59PMunchCurrently I'm just grabbing the lines it refers to out of the file, but then I'd have to parse the procedure definitions myself. For example if the signature sets a default value and uses type inference to populate that field..
08:31:10adeohluwaaii...I'll look for another excuse to use nim + jester
08:31:38PMunchadeohluwa, it would certainly be interesting if you tried though :)
08:31:52PMunchIf for nothing else then to know were it lies
08:33:02AraqPMunch, my solution doesn't have anything to do with where the symbols come from
08:33:07PMunchApparently someone has already tried: https://github.com/nanoant/WebFrameworkBenchmark
08:33:26PMunchAraq, which solution?
08:34:15AraqPMunch, my pragma solution with dynlib, importc
08:34:42PMunchYeah, but that was the other way round wasn't it, loading symbols from a dynlib
08:35:05PMunchWhat I want is to get a symbol in the dynlib, from the main executable
08:36:58adeohluwaPMunch: I see nim multiple times there with asyncHttpServer 3 times with different results
08:38:02PMunchFrom my example files yesterday: https://pastebin.com/xMUr8Qnc this is the main program. Currently it passes the myProc procedure to the dynlib through the setup call. https://pastebin.com/acK0dAXS this is the dynlib, currently it takes the toCall proc from the setup call. What I want to do is get around the setup proc and have the symbol loaded dynamically for the dynlib code when it is read.
08:38:19PMunchadeohluwa, yeah.. Could be different versions of Nim?
08:39:36*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:44:20adeohluwaPMunch: just noticed they were compiled with different flags
08:45:34*claudiuinberlin joined #nim
08:47:51PMunchAh right
08:50:52AraqPMunch, loading from an .exe is possible but maybe OS specific
08:51:11Araqit's done with .dynlib, importc anyway, I don't understand your problem
08:53:15PMunchError: 'dynlib' requires 'exportc'
08:53:22PMunchThat's with {.dynlib, importc.}
08:53:41PMunchhttps://stackoverflow.com/a/17083153
08:53:53PMunchThat's what I'm trying to do, but in Nim of course
08:54:42PMunchAnd it works fine if I do annotate a proc definition with {.importc, extern: "<mangled name>".} in the dynlib
09:04:31*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:05:57PMunchHmm, why doesn't nimsuggest give me the signature with outline or "def" on the definition?
09:06:08*floppydh joined #nim
09:06:32*craigger quit (Ping timeout: 260 seconds)
09:07:35*craigger_ joined #nim
09:08:01couven92because nimsuggest sometimes is a bit iffy :P try `con` as well to make sure?
09:08:05couven92PMunch, ^
09:08:24couven92(i have no idea what con does, but hey sometimes that works for me :P )
09:08:33PMunchcon does bugger all..
09:11:19*voiceftp joined #nim
09:13:25PMunchThis is just getting ridiculous..
09:18:59*claudiuinberlin joined #nim
09:23:16ViktorI wonder how the http performance would be if Nim would open a new thread for each request.
09:23:48couven92Viktor, hmm... performance there is very OS-specific
09:24:21couven92there are very different ideas of what a thread is depending on what platform you're sitting
09:24:29couven92on
09:25:04Viktorwell http servers are probably deployed mostly to unix based environments
09:25:28Viktordo I understand correctly that if we use AsyncHTTPServer, by default it only uses one core of the machine?
09:25:45couven92Viktor, true, but still there might be differences... Also it highly depends WHAT you want to do with your server
09:26:17FromGitter<data-man> @PMunch Will this help you? https://github.com/transfuturist/plugins
09:26:28couven92Something that is very performant for plaintext benchmark responses is not necessarily the best for other use-cases
09:26:38PMunchFor reference, this is how I do it now Araq: https://pastebin.com/NR3xnHU2 https://pastebin.com/SqBRAq9C The output of running main is three "Something cool" and theValue is set to 5
09:27:08PMunchdata-man, maybe. I'll look at it when I get back
09:32:47adeohluwacouven92: so the answer is it depends
09:33:09adeohluwathe answer I want is nim above all
09:34:14Viktorabeohluwa, do you actually expect to have more than 83 753 requests per second on your server?
09:35:28cremThat's 2 times more than google has!
09:37:14Viktorso, the benchmark does not matter that much I guess.. :) For me why it matters more that it is type safe, easy to read, uses way less memory than nodejs, and it is just more fun to write.
09:37:59Viktor*why = what
09:40:00*JappleAck joined #nim
09:40:57*vlad1777d quit (Ping timeout: 260 seconds)
09:41:12*miran quit (Quit: Page closed)
09:42:26FromGitter<gokr> @Viktor see my blog article on threaded socket server
09:51:28adeohluwacrem: makes sense so what you are saying is way before performance ever becomes a bottleneck memory will be main issue
09:52:23adeohluwaViktor: I'll be switching one nodejs app to nim lang to see how it goes
09:53:34FromGitter<gokr> There are almost always other bottlenecks, like db, hitting disk, yaddayadda
09:55:05FromGitter<gokr> One thing very nice with nim is ability to do threads. And also, much less chaos in lang/libs compared to js world
09:56:24FromGitter<gokr> I just wrote a combined Jester and MQTT daemon that spawns jobs in threads. Very nice.
10:00:09PMunchHad a look at the lib data-man. Not quite sure how it works/what it dos
10:00:42*zolk3ri joined #nim
10:03:59Viktorabeohluwa, I am also working on something similar. I am migrating my pet-project api to Nim. But first I will finish the Nim in Action book to be more confortable with it.
10:08:16*gokr joined #nim
10:17:19adeohluwanice be sure to report the differences between nim vs other ... would be cool to have a peek
10:35:15*miran joined #nim
10:41:01Viktorgokr, where can I find your blog about this?
10:41:31*elrood joined #nim
10:44:24gokrhttp://goran.krampe.se/category/nim
10:45:40Viktorcool, thanks I am going to check it out!
10:49:51gokrThis is also a very nice blog with many nim articles: https://hookrace.net/blog/nim/
10:50:09Viktorgokr are you planning on writing a blogpost about the Jester + MQTT app?
10:50:19gokryeah
10:50:24gokrIt's open source btw...
10:50:40Viktorand where is it?
10:50:44gokrhttps://github.com/evothings/ecraft2learn/tree/master/arduinobot
10:51:04ViktorI am at the learning and hamstering info stage with Nim :) So collecting everything I can.
10:51:29Viktorcheers
10:52:04couven92dom96, thanks for the CC on the VS2017 issue, I am working on it
11:02:47*Snircle joined #nim
11:05:57FromGitter<mratsim> I'm at a GraphQL Meetup, a new tiny query syntax from Facebook that aims to replace REST, it's quite interesting and I think would be really neat to have in Nim
11:09:46FromGitter<BigEpsilon> Hi, does any body knows if this bug is already known or if I must fill a new one ? https://play.nim-lang.org/?gist=4f731e9ed021b74eb8909ce700ec6d4f
11:10:34PMunchHuh, mratsim. GraphQL does look interesting
11:11:22FromGitter<data-man> @mratsim https://github.com/samdmarshall/GraphQL.nim
11:11:39*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:12:13*claudiuinberlin joined #nim
11:12:51FromGitter<mratsim> :) it's a C wrapper though not sure if it works with the JS backend
11:13:09PMunchProbably wouldn't..
11:13:21PMunchBut you could always wrap the JS implementation
11:13:33PMunchOr reimplement in Nim of course :)
11:15:48dom96Yeah, GraphQL is awesome. I've used it :)
11:16:17dom96Implementing the spec in Nim would be a fun exercise
11:18:47ViktorI would also add something to the Nim whish list: Thrift
11:23:15*vlad1777d joined #nim
11:25:50subsetparkWould you just implement it based on attribute lookup?
11:32:01*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:39:48FromGitter<gokr> We are just now setting up a "stack" for some future projects - Elixir+Phoenix+Postgres and then Vuejs+Quasar I think on the frontend. Didn't dare go GraphQL just yet though.
11:43:26*claudiuinberlin joined #nim
11:49:10*sleepyqt joined #nim
11:51:46*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:54:21*claudiuinberlin joined #nim
11:55:18floppydhI have a template FOO that I pass a code-block that calls another template BAR, before it does so, I define a variable in FOO, which I want to use in BAR, but I can't because BAR seems to be "expanded" first before FOO and the variable doesn't exist, at least it seems so - any pointers?
11:55:49floppydhoh {.inject.} does it
12:01:40FromGitter<Yardanico> code snippet please ? :)
12:06:37zolk3ri'lo nico
12:07:32FromGitter<Yardanico> yay
12:07:33FromGitter<Yardanico> https://github.com/nim-lang/Nim/pull/6058#issuecomment-339304243
12:08:28FromGitter<Yardanico> we'll get a fast (parallel) and nice testament
12:10:07zolk3rithat is a long line indeed
12:10:15zolk3riand long func name
12:10:17zolk3rixD
12:10:49zolk3rimake it "TestResultFactoryGeneratorPanelPartialLikeTotes"
12:10:54PMunchHe comes from C# where all names are long
12:12:13PMunchzolk3ri, have you seen this: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
12:12:29zolk3rioh yeah oh my god
12:12:43zolk3rigradle, even..
12:13:06GitDisc<GooRoo> have a question regarding length of code lines: is the limitation to 80 characters still reasonable?
12:13:11PMunchhttps://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/blob/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/StandardFizzBuzz.java
12:13:18zolk3riPMunch: lmaop
12:13:54PMunchGooRoo, yeah it has it's uses. GitHub diffs look horrible for example, if you don't limit yourself to 80 characters.
12:14:24FromGitter<Yardanico> @GooRoo: yes
12:14:42FromGitter<Yardanico> com.seriouscompany.business.java.fizzbuzz.packagenamingpackage.interfaces.factories.FizzBuzzSolutionStrategyFactory
12:14:53zolk3riyeah, and long lines usually implies your code needs refactoring
12:14:58zolk3riimply
12:15:32GitDisc<GooRoo> not "usually". It really depends IMO
12:15:45GitDisc<GooRoo> also it depends on what to consider as "long line"
12:16:00zolk3ri>80 chars
12:16:27GitDisc<GooRoo> this limitation is a bit artificial nowadays, isn't it
12:16:41GitDisc<GooRoo> in the past you just couldn't see more on your screen
12:17:12zolk3riit's still annoying if you have several windows open side by side
12:17:20PMunchWell, it could just as well be 90 characters. But 80 characters have been a standard for so long so tools (like GitHub) might do strange things if you break it
12:17:48FromGitter<Yardanico> also horizontal scrolling is annoying if you didn't know :)
12:18:00zolk3riyeah
12:18:49PMunchThere is a guy on YouTube who has a nice talk about this
12:19:06zolk3riGooRoo: https://stackoverflow.com/a/578318
12:19:07PMunchAmongst other things why 80 characters are a good thing to stick to
12:19:44FromGitter<Yardanico> zolk3ri: that's from 2009
12:19:46FromGitter<Yardanico> a bit old :)
12:19:56GitDisc<GooRoo> It all sounds like a legacy problems. Tools are bad because of legacy limitations. Horizontal scrolling is bad because historically we got vertical one on our mouses, but then monitors became wide-screen
12:20:14FromGitter<BigEpsilon> If some one have an idea https://forum.nim-lang.org/t/3281
12:20:14FromGitter<Yardanico> @GooRoo: but what if you need to have two editors open side-by-side?
12:20:20FromGitter<Yardanico> you'll still need horizontal scrolling
12:20:24zolk3riYardanico: And the 80 column limit is even older :)
12:20:31PMunchKevlin Hnney is the guy
12:20:38PMunchTalks a lot about these kinds of things
12:21:35GitDisc<GooRoo> I wonder how many people have 21:9 screens 
12:21:52zolk3riYardanico: and the points still apply, even today :P
12:23:49FromGitter<Yardanico> as most say today, it's better to have 80 chars soft-limit
12:23:55FromGitter<Yardanico> and ~100-120 - hard limit
12:24:13*dddddd joined #nim
12:24:31GitDisc<GooRoo> I usually prefer exactly 120
12:24:50GitDisc<GooRoo> but have 80 limit at work because of Gerrit
12:24:58GitDisc<GooRoo> it looks like a shit
12:25:47FromGitter<Yardanico> well 120 everywhere is a bit too high :)
12:26:22zolk3riI doubt you would need long lines if you didn't use obnoxiously long names.
12:26:59floppydhthats just crazy :) https://github.com/nim-lang/Nim/blob/49c6dbf4ab3e60a0e850ac876e54c0c6bc07de89/lib/pure/future.nim#L125
12:27:34zolk3riGooRoo: What do you mean by "exactly"? If there's not 120 characters on the line you add some till it is? :P
12:27:55floppydhcreating a type and instantiating it in a module as a global just to get the syntax you want :)
12:28:09FromGitter<Yardanico> floppydh: have another way?
12:28:24floppydhYardanico no, I just think it's incredibly dirty
12:28:44floppydhYardanico, don't think it's possible in another way
12:28:46FromGitter<Yardanico> well yes, because nim doesn't have built-in list comprehensions
12:28:55FromGitter<Yardanico> so it will probably be *dirty*
12:29:02floppydhYardanico, you can't nest those lcs either no?
12:29:03GitDisc<GooRoo> @zolk3ri, sure I add some spacing inbetween 
12:29:29FromGitter<Yardanico> floppydh: you can try
12:29:36FromGitter<Yardanico> but I don't really think you should use them
12:29:41FromGitter<Yardanico> they're rarely useful
12:29:52floppydhThis particular implementation or list-comprehensions in general?
12:30:08FromGitter<Yardanico> list comprehensions in nim
12:30:13FromGitter<Yardanico> hopefully we'll get "for" as an expression
12:30:14floppydhI benched them they perform fine, just the syntax is awful and limited
12:30:28FromGitter<Yardanico> well because they're not built-in, as I said :P
12:30:40FromGitter<Yardanico> a lot of features are not built-in in nim to keep core language small
12:30:45FromGitter<Yardanico> e.g. async/await
12:30:53floppydhwell you can blame limited expression ability in Nim as well tho
12:30:57FromGitter<Yardanico> it's implemented with macros and iterators
12:31:14floppydhlike just because it aint a language features doesn't mean it has to be this bad to use
12:31:45FromGitter<Yardanico> "However, this is no real restriction because Nim's syntax is flexible enough anyway." :)
12:32:04floppydhwell, mb you could do the lc-implementation better
12:32:14FromGitter<Yardanico> the thing is: you can't pass INVALID nim syntax to the macro
12:32:20floppydhI'm aware
12:32:27dom96gokr: Why Elixir?
12:33:11floppydhdon't think current lc implementation does type-deduction either, that might be possible to do with macros
12:33:26FromGitter<Yardanico> it would be hard to do
12:33:28*adeohluwa quit (Quit: Connection closed for inactivity)
12:33:37floppydhhard sure, but possible
12:33:50floppydhI don't think hard to do is a reason to push things into the language instead of into a lib
12:33:54floppydhno?
12:34:02FromGitter<Yardanico> no
12:34:17FromGitter<Yardanico> nim core language tries to not have 100500 features
12:35:03floppydhright, but I'm kinda with you that I also hope list-comprehensions or something along those lines become really comfortably to use
12:35:19FromGitter<Yardanico> it would be really hard to support all those features in the compiler
12:35:33FromGitter<Yardanico> floppydh: as I said, "for" loop will be an expression
12:35:38FromGitter<Yardanico> so you'll be able to do something like
12:36:02FromGitter<Yardanico> let a = for item in items: for data in item: data
12:36:18floppydhYardanico looks good
12:36:21FromGitter<Yardanico> but maybe not in one line
12:36:58subsetparkI have found that `lc[]` is not necessary in 90% of situations that `mapIt` suffices perfectly
12:37:01floppydhthats not feature-complete to lcs no? - let a = [ x*x for x in xs ]
12:37:24FromGitter<Yardanico> let a = for x in xs: x * x
12:38:25dom96in fact, implementing 'for' as an expression would be a fun exercise in compiler hacking :)
12:38:50floppydhYardanico guess that's fine
12:39:10dom96But there surely are other things that the list comprehension syntax allows which for loop as an expression won't
12:39:22floppydh:(
12:39:49FromGitter<Yardanico> well I saw this a lot of times already: people want nim to have all features possible in another languages
12:40:03FromGitter<Yardanico> and they complain if they don't find some feature :P (not about list comps, just in general)
12:40:30floppydhYardanico: well, lcs are really an intrisic part of python and there's potential for python people to look to Nim?
12:40:47floppydhbut sure, that's just PLs in general no? - people try to appyl what they learnt to something new
12:40:48*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:40:53FromGitter<Yardanico> yes, but Nim is not Python
12:41:06FromGitter<Yardanico> nim doesn't try to clone python fully
12:41:18floppydhYardanico, sure I get that, I just see no reasons why lcs shouldnt be in Nim ? They seem to fit really well
12:41:25FromGitter<Yardanico> well they are in nim
12:41:32FromGitter<Yardanico> in future module :)
12:41:43floppydhYardanico: I thought we both agreed that one wouldn't really suggest using them
12:42:14FromGitter<Yardanico> but they *are* usable, I just say that they're not the best since you need to write types yourself
12:42:47floppydhI don't mind not having lcs, but then something comparable that covers thigns like filtering and nested iteration and assigns them to a value in a one-liner :P
12:43:04floppydhwell that, and they can't be nested AFAIS
12:43:05FromGitter<Yardanico> did you ever look at templates in sequtils module?
12:43:14floppydhI did not
12:43:28FromGitter<Yardanico> there's filterIt, mapIt, etc.. templates
12:43:36floppydhYardanico: ah thanks I'll look into them
12:43:45FromGitter<Yardanico> e.g. @[1, 2, 3, 4, 5].filterIt(it > 3).mapIt(it * 5)
12:44:01FromGitter<Yardanico> !eval import sequtils; echo @[1, 2, 3, 4, 5].filterIt(it > 3).mapIt(it * 5)
12:44:03NimBot@[20, 25]
12:44:13floppydhmhhh, let me bench those
12:44:16floppydh"bench"
12:45:03FromGitter<Yardanico> benchmarking things like this isn't the best idea IMO, because if you need to write fast code you wouldn't write list comps anyway
12:45:14floppydhYardanico: how so?
12:45:42floppydhYardanico: I mean I guess you can still write generator expressions
12:46:27FromGitter<Yardanico> btw, use "nimbench" for benchmarking
12:46:28floppydhdon't filter/map/reduce produce a lot of temporaries?
12:46:37floppydhif you chain them
12:46:52FromGitter<Yardanico> it does, because nim has value semantics (copying)
12:47:08FromGitter<Yardanico> well there are inplace templates too
12:47:09FromGitter<Yardanico> in sequtils
12:47:20FromGitter<Yardanico> e.g. applyIt
12:47:20floppydhyeah I generally dislike those for that reason, they're used like that in new JS/ES6 too, but those temporaries also can't be optimized away in these
12:47:45floppydhthere wont be temporaries in an lc AFAIK in python
12:47:59FromGitter<Yardanico> so did you benchmark these templates?
12:48:06floppydhYardanico on it
12:48:10FromGitter<Yardanico> yes, because list comprehensions are a core feature of python, as I said
12:48:49FromGitter<Yardanico> I can ask you too, for example - why you can't write simple templates/macros in python (without additional modules) ?
12:49:37*gokr quit (Ping timeout: 248 seconds)
12:50:33floppydhYardanico: because python code wants to be free of runtime/compiletime separations? idk
12:52:27FromGitter<Yardanico> and anyway, I don't think it's actually good to compare python and nim, since python is interpreted, and nim is compiled :)
12:54:12floppydhYardanico, well I mean, I don't even think its that much of a python thing, python just does lcs really well, they just make what they do more concise and more explicit then a bunch of nested loops and the like I feel and they don't produce unnecessary temporaries
12:56:14floppydhjust like I think "in" ought to be in every PL? it seems to just fit everywhere
12:56:37FromGitter<Yardanico> "in"?
12:57:08floppydhYardanico: in-keyword
12:58:15zolk3riocaml has it
12:59:14floppydhzolk3ri: doesn't it mean something else then how its used in pyton or nim?
13:00:59*claudiuinberlin joined #nim
13:04:34zolk3rifloppydh: In OCaml it's just either "let foo = expr in expr" or "let foo = expr;;", ;; ends the block of code, whereas in only denotes the end of the let binding.
13:05:04floppydhzolk3ri: right it has a different meaning
13:12:00FromGitter<mratsim> @floppydh @yardanico check out the logs from last week but Araq or dom96 said that after for becomes an expression they will have a look into list comprehension and
13:12:36floppydhmratsim oh neat, thanks for the info
13:13:08FromGitter<Yardanico> @mratsim I said about that
13:13:24FromGitter<Yardanico> I know that araq was talking about this
13:13:54dom96I'd be interested to know what limitations you guys can come up with for 'for expressions'
13:14:19dom96I think list comprehensions hold a bit more features than for expressions would
13:14:26dom96but maybe I should just stop asking and look into it myself
13:14:42FromGitter<mratsim> @BigEpsilon for your issue, will reply in 5 hours when I'm back home but to interface with Cuda C++ in Arraymancer I had to use C++ types defined in templates. Basically <'0> for return value type or <'1> for first arg, etc and <'*0> in case the return value is a pointer T.
13:15:33FromGitter<BigEpsilon> @mratsim , thanks :)
13:16:07FromGitter<BigEpsilon> but actualy my problem is that I want to access to the value of the generic parameter, not its type
13:16:46FromGitter<BigEpsilon> ie, i want to generate Vec<double, 3> for example
13:16:57FromGitter<BigEpsilon> not Vec<double, int>
13:17:14FromGitter<BigEpsilon> and there is nothing in the doc for that
13:17:25FromGitter<mratsim> Mmmm I see, you want to access static[int]
13:17:30FromGitter<BigEpsilon> yes
13:17:35FromGitter<BigEpsilon> exactly
13:17:47*craigger_ quit (Ping timeout: 246 seconds)
13:18:33FromGitter<BigEpsilon> There are alot of such types in opencv
13:18:43FromGitter<BigEpsilon> like compile time matrices
13:18:50FromGitter<mratsim> Feature request I guess or put that in a cpp file and try to use c2nim on it, who knows
13:19:21FromGitter<BigEpsilon> I worked alot on c2nim already
13:19:55FromGitter<mratsim> You probably will encounter this at one point by the way: https://github.com/nim-lang/Nim/issues/6415
13:20:10*craigger joined #nim
13:20:49FromGitter<BigEpsilon> did not have this bug until now
13:20:59FromGitter<BigEpsilon> but yes I'll maybe inconter it
13:21:17FromGitter<BigEpsilon> I started to doubt if it is worth it
13:21:25FromGitter<BigEpsilon> fighting all this bugs
13:21:49FromGitter<BigEpsilon> because there is always another one hiding in the corner
13:22:11FromGitter<BigEpsilon> If you have time it is not a big deal
13:22:13*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
13:22:13FromGitter<mratsim> Or maybe I just didn't understand how to map C++ Generics with Nim generics. It works fine for functions but not for structs/objects
13:23:05FromGitter<BigEpsilon> I'll show you how I did it then for some types
13:24:47FromGitter<BigEpsilon> https://gist.github.com/BigEpsilon/3a07021a66175d50d0adf7d918fdeb21
13:25:12FromGitter<BigEpsilon> ah yes one with generics
13:26:16FromGitter<mratsim> Docs say my way should work but the same syntax for procs is possible if fine-grained control is needed: https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-objects
13:28:38FromGitter<BigEpsilon> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f09186d6c36fca31956918]
13:31:52FromGitter<BigEpsilon> this works and I can call it with: ⏎ ⏎ ```var r : Rect_u[float] ⏎ echo r.x ⏎ echo r.y``` [https://gitter.im/nim-lang/Nim?at=59f092480182fa5f4d775113]
14:01:37FromGitter<mratsim> Building Street Fighter AI that reads frames and uses the joystick: ://medium.com/gyroscopesoftware/how-we-built-an-ai-to-play-street-fighter-ii-can-you-beat-it-9542ba43f02b hopefully I'll bring Arraymancer there soon (TM)
14:01:40FromGitter<mratsim> https
14:06:51*nsf quit (Quit: WeeChat 1.9)
14:11:58Viktormratsim, is this related to Nim?
14:12:59PMunchViktor, Arraymancer is written in Nim
14:13:10Viktorah ok
14:17:30dom96Build a Euro Truck Simulator 2 bot instead
14:17:37dom96You can say that has a practical reason to exist :)
14:18:24FromGitter<mratsim> @Viktor I'm building a multidimensional array and deep learning library in Nim
14:18:25captainkraftmratsim: The problem wasn't the path to the C file, it was that it wasn't spitting out a .o file into the nimcache folder.
14:18:28PMunchThere was a guy who built an AI to drive around in GTA
14:18:35PMunchBased on reading the screen
14:18:38captainkraftmratsim: that was re: .compile pragma
14:18:59Viktormratsim, awesome!
14:21:14FromGitter<mratsim> Mmm I had this issue but few months ago @captainkraft, the c file had to be in nimcache. But last time I tried (like 2 weeks ago) it was done properly without needing to move the file to nimcache iirc
14:21:40*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:22:15captainkraftI have the nuklear.nim file with .compile pragma and bind.c in same directory. When I import nuklear.nim, presumably bind.c should be compiled and bind.o should be put into nimcache?
14:22:24FromGitter<mratsim> @Pmunch if you search "OpenAI Gym" you will find Python libraries and exercises to train an AI on various games, Pacman, super Mario and others iirc
14:22:48FromGitter<mratsim> By reading the screen and simulating joysticks input
14:23:15PMunchmratsim, neat!
14:23:43PMunchSuch a silly problem, with such a complex solution :P
14:23:58FromGitter<mratsim> @captainkraft yes
14:24:14captainkraftIf I manually compile bind.c and move the bind.o into nimcache, it seems to work fine. I'm just not sure why bind.o doesn't exist when importing nuklear.nim
14:24:47Araqcaptainkraft, me neither, I used .compile for directories, didn't fail me
14:24:54FromGitter<mratsim> Try the compile example in the manual to check if it works
14:25:46captainkraftI'm on my laptop now, and it works... Maybe I just did something dumb on my other computer.
14:27:53FromGitter<mratsim> Clear your nimcache and retry to make sure :p
14:33:12*claudiuinberlin joined #nim
14:33:48*claudiuinberlin quit (Client Quit)
14:37:40captainkraftTested on both computers after clearing nimcache. It works...
14:38:00captainkraftNothing to see here
14:40:53Viktornimcache is platform specific, right? Meaning that it will be different on Mac than on Linux
14:40:53FromGitter<dandevelo> Is there any simple function to remove a prefix from a string?
14:46:04PMunchdandevelo set length or variable?
14:46:27PMunchViktor, yes I'm pretty sure it would differ
14:46:58PMunchThink about if you had a "when defined(osx)" in your code. It would be compiled away on linux and the nimcache would not have it
14:47:11FromGitter<dandevelo> @PMunch variable
14:48:01FromGitter<Yardanico> @dandevelo yes
14:48:17FromGitter<Yardanico> firstly - you can just make a slice
14:48:23FromGitter<Yardanico> e.g. mystring = mystring[4..^1]
14:48:41FromGitter<dandevelo> Suppose I receive a string in the file://C:/doc.txt and I want to strip the file:// prefix
14:48:42Araqyay, made the tester run in parallel
14:48:49FromGitter<Yardanico> really?
14:49:02FromGitter<Yardanico> does it still output html result?
14:49:03Araqyep, now my machine is crawling
14:49:16FromGitter<Yardanico> @dandevelo you can copy-paste this proc until it's merged :) https://github.com/nim-lang/Nim/pull/6473
14:49:29Araq100% CPU :-)
14:49:33FromGitter<Yardanico> lol, nice
14:49:42FromGitter<Yardanico> Araq: will you push it or there are some specific problems?
14:50:17Araqwill push into a branch I guess
14:50:45FromGitter<dandevelo> @Yardanico thanks!
14:51:51*ShalokShalom joined #nim
14:52:37Araqhmm never saw the machine this laggy
14:53:06AraqI need to keep 'allslow' as an option
14:54:59FromGitter<Yardanico> but yeah, now we will forget about timeouts on CI servers for a year (or less) :D
14:58:26*claudiuinberlin joined #nim
14:59:59*couven92 quit (Ping timeout: 258 seconds)
15:03:26dom96Araq: What speed up are you getting?
15:05:00*nathanj joined #nim
15:05:19FromGitter<mratsim> @dom96 there is a 404 when accessing page 2 of this thread: https://forum.nim-lang.org/t/3276
15:05:42dom96fixed
15:06:22FromGitter<mratsim> 10 sec to fix? Impressive!
15:06:46FromGitter<mratsim> Ah it was a new user
15:07:11*PMunch quit (Quit: Leaving)
15:08:35FromGitter<Yardanico> as usual
15:10:57*Jesin quit (Quit: Leaving)
15:13:14*Jesin joined #nim
15:13:51Araqdom96, not sure, 15 minutes?
15:14:04dom96you should measure :)
15:16:47*joshbaptiste_ quit (Quit: WeeChat 1.6)
15:16:48Araqyay just made a bug because json has a 'contains' proc
15:16:57*joshbaptiste joined #nim
15:17:11Araqwhen every type implements every function you lost all type safety
15:17:35dom96which contains?
15:17:43*gokr joined #nim
15:17:53Araqjson
15:17:59dom96what's the signature?
15:18:07Araq let state = elem["result"].str
15:18:07Araq if state.contains("reSuccess"): inc result.successCount
15:18:14AraqI forgot the '.str'
15:18:23FromGitter<Yardanico> ah, you use json?
15:18:24FromGitter<Yardanico> neat
15:18:45dom96Still not answering my question...
15:18:48dom96presumably this one https://nim-lang.org/docs/json.html#contains,JsonNode,string
15:18:56Araqhttps://nim-lang.org/docs/json.html#contains,JsonNode,string
15:19:41FromGitter<Yardanico> hmm, google closure compiler seems to be very neat
15:19:48FromGitter<Yardanico> e.g. it can inline functions
15:20:57gokrHmmm, my messages got lost I think, I will repeat:
15:21:04dom96Araq: yeah, that's a silly one
15:21:12gokrdom96: Hehe, "why Elixir?" - why not? ;)
15:21:20dom96gokr: why not Nim? :P
15:21:22gokrWhen it comes to maturity, stability, scalability, robustness as a web backend - I would say Elixir is a very strong contender.
15:21:29gokrNo matter how much I like Nim, I can't see it really competing.
15:21:36zolk3riC
15:21:36dom96Why? :)
15:21:44dom96i.e. how can we improve?
15:21:57gokrWell, I presume you know a fair bit about Elixir/Phoenix, right?
15:22:41dom96I wouldn't say that. IIRC it runs on the Erlang VM?
15:22:48gokrYeah.
15:23:02gokrSo Elixir is the new lang running on the Erlang platform.
15:23:13gokrPhoenix is the web framework.
15:23:34floppydhwell if nim would run on Erlang VM ...
15:23:35gokrhttp://phoenixframework.org
15:23:54gokrhttps://elixir-lang.org
15:24:47gokrfloppydh: A bit of a misfit i think, Erlang is a bit special, but well, who knows
15:25:13gokrBut if we were to make a list of what Nim needs to compete - it would be .... a long list.
15:25:16floppydhgokr: yeah was more like a joke :3
15:25:47dom96gokr: Can you give some major things at least?
15:25:55gokrI gotta run, but yeah - if Nim really wants to be "the best" in that arena - then IMHO Elixir and Phoenix is the stuff to beat.
15:26:15Araqyeah we don't want to be "the best" in that arena
15:26:17floppydhYou can hotwswap code, altough almost noone seems to use it
15:26:22gokrOk, so the Erlang VM scales almost linearly on multicore architectures.
15:26:43dom96Okay, so performance is one.
15:26:45gokrIt uses "green" Processes on top of threads I think. Scales insanely.
15:27:00gokrI mean SCALES.
15:27:16gokrThen you have the whole OTP platform.
15:27:38Araqyeah web scale, whatever.
15:27:40gokrThat's Ericsson's crazy robust platform for making 100% available systems etc etc.
15:27:44floppydhAraq: :D
15:27:49dom96Araq: Shush
15:27:56gokrDon't make fun of it - it's very good shit.
15:28:05gokrJust read up on what Whatsapp was built with.
15:28:14AraqI did read that months ago
15:28:14floppydhalso discord
15:28:19gokrHow they scaled to 400 million users on 60 servers or what it was.
15:28:26floppydhhttps://blog.discordapp.com/scaling-elixir-f9b8e1e7c29b
15:28:49gokrThere are also fun articles on how they scaled Phoenix on a single machine to 2 million concurrent connections IIRC.
15:28:51dom96Well that sure is discouraging D:
15:29:16gokrWhat?
15:29:30floppydhtheir actor model apparently is really good and the VM just has been taken care of for quite a long time now no
15:29:49gokrYes, very highly tuned. Extremely good latency numbers.
15:30:21floppydhif you read the above discord article you'll see where they started to have issues with it tho and where they started to write own libs to fix it
15:30:31floppydhbut they still conclude that it was "worth it"
15:30:34gokrI gotta go, back later
15:31:08gokrBut the whole OTP stuff - Erlang etc - was built to run Ericsson telephone switches - with 0 downtime.
15:31:43gokrIt's designed for extreme robustness. Isolated processes can die etc, without taking anything else down.
15:33:53dom96Araq: So what do we want to be "the best" in?
15:34:53Araqfloppydh, your remark is spot on ;-)
15:35:04floppydhbeing enjoyable is good enough to me and Nim is that already atm
15:35:28Araq"Sessions would block on these requests until they timed out while receiving messages from other services, causing them to balloon their message queues and eventually OOM the whole Erlang VM resulting in cascading service outages." yay isolated processes
15:35:59*gokr quit (Ping timeout: 248 seconds)
15:39:11Araqdom96, we don't want to be "the best", we want to be really, really good at CPU bound and IO bound stuff
15:39:20floppydhI mean with all new things it's really hyped and I'm sure as everything problems will show when you really work with it, but because it's rather hard to get into theres a lot of hype when most stay on the outside not being able to pass that entry barrier
15:39:52Araqdom96, but read the article, there is nothing that wouldn't be possible with Nim as it is now, ymmv
15:40:10Araq"oh we only had to fix this and that and the stdlib and replace modules with C"
15:41:30Araqnot to mention that most async implementations still beat pico-micro-threads
15:42:27*floppydh quit (Quit: WeeChat 1.9.1)
15:42:44dom96But I want us to be the best :(
15:42:59Araqor that this way of writing software doesn't work for many applications like compilers
15:44:52FromGitter<Yardanico> dom96: find a large company to support nim
15:44:56FromGitter<Yardanico> and then we'll be the best :P
15:46:23FromGitter<Gooseus> should build a large company (read sustainable) to support yourselves... I had a question about async http stuff and the event loop like 10 hours ago in here, I'll brb to restate if that's way too far to scroll
15:47:37dom96Gooseus: no need to restate: https://irclogs.nim-lang.org/25-10-2017.html#05:11:59
15:48:11FromGitter<Gooseus> beautiful... alright, on a call, would love any feedback/insight!
15:48:15FromGitter<Yardanico> @Gooseus if you want to have blocked IO (e.g. you're polling stuff), you shouldn't use async at all
15:48:23FromGitter<Yardanico> *e.g. if you want to wait for a request
15:48:30FromGitter<Yardanico> well you can still use async
15:48:34FromGitter<Yardanico> but use things like waitFor
15:49:16FromGitter<Yardanico> and your example wouldn't compile anyway, since you need to call async procs from async procs
15:49:25FromGitter<Yardanico> or from any procs using waitFor / asyncCheck
15:51:05*ShalokShalom quit (Remote host closed the connection)
15:51:27FromGitter<Yardanico> so what's your use case?
15:57:35FromGitter<Varriount> @Gooseus I'm awake again. :D
15:58:00dom96I'm also a bit confused about what you actually want
15:58:56dom96keep in mind that ``waitFor`` calls ``poll``
15:59:07dom96the requests won't make progress until ``poll`` is called
15:59:09*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:59:24dom96I don't understand the advantage that performing this early polling brings though
15:59:27*claudiuinberlin joined #nim
15:59:57*claudiuinberlin quit (Client Quit)
16:00:56FromGitter<Varriount> @dom96 You might look at the modifications I made
16:01:07GitDisc<treeform> yeah the async http stuff still confuses me, stuck with this odd error {.locks: <unknown>.} message...
16:01:11dom96link?
16:01:27FromGitter<Yardanico> treeform: add gcsafe pragma to your proc
16:01:29dom96treeform: yeah, that's a result of GC safety :(
16:01:32FromGitter<Yardanico> can probably help it :)
16:01:42dom96That error needs to be improved
16:02:01FromGitter<Varriount> @dom96 https://irclogs.nim-lang.org/25-10-2017.html#06:02:17
16:02:41dom96hrm, I can't find a bug to improve this error
16:02:53dom96treeform: could you submit a bug report for this? presumably you have a nice small test case
16:03:08federico3all that hype around erlang was from 10 years ago. It had very little traction and it's not used at large scale because it's not solving the real problems.
16:03:35GitDisc<treeform> Not really I am trying to use this non-documented websocket library, and I though it was just written badly
16:03:47*claudiuinberlin joined #nim
16:03:48GitDisc<treeform> gcsafe worked though
16:03:52dom96niv's?
16:03:52GitDisc<treeform> works great now
16:03:55GitDisc<treeform> yes
16:04:05dom96I use it in my snake game in case you want some examples
16:04:15dom96although to be honest the API of that library needs improvement
16:04:15FromGitter<mratsim> @Araq CPU-bound is overrated, I would prefer if Nim was really really strong at memory-bound stuff. Things mentioned here: https://crd.lbl.gov/departments/computer-science/PAR/research/roofline/
16:05:37GitDisc<treeform> dom96 I don't like that it uses exceptions for control flow
16:07:05GitDisc<treeform> ws.getFD().AsyncFD.int marks things with {.locks: <unknown>.}
16:07:27GitDisc<treeform> if i remove that I no longer get locks unkown
16:07:34*PMunch joined #nim
16:07:52dom96weird
16:08:06dom96please report this somewhere :)
16:08:17GitDisc<treeform> i'll am making a smaller example
16:09:35GitDisc<treeform> oh that is not it, nothing makes sense ...
16:10:03*miran_ joined #nim
16:10:24*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
16:14:50GitDisc<treeform> dom96, https://gist.github.com/treeform/af788a3cc79e876e1271f446c343186c here is the smallest sample I could make, can you teach me how to report this correctly?
16:15:51dom96Sure: https://github.com/nim-lang/Nim/issues/new
16:16:12dom96Call it... hrm
16:16:25dom96"No info about gcsafety in error message"
16:16:26GitDisc<treeform> it might be this issue: https://github.com/nim-lang/Nim/issues/6186
16:16:46dom96oh, you're right
16:16:57GitDisc<treeform> seems like same as well: https://github.com/nim-lang/Nim/issues/5415
16:17:09dom96Add your snippet in there anyway and say you're affected :)
16:17:17*Viktor quit (Quit: Viktor)
16:18:35GitDisc<treeform> Does your niv/websocket.nim project compile? Did you just add gcsafe?
16:19:14dom96I haven't compiled it in a while but here is the code https://github.com/dom96/snake/blob/master/snake/server.nim
16:21:51*Andris_zbx quit (Remote host closed the connection)
16:22:36*JappleAck quit (Quit: Leaving)
16:23:34GitDisc<treeform> Yeah your snake server gets the same error as I do
16:23:47*Trustable joined #nim
16:23:54GitDisc<treeform> https://gist.github.com/treeform/6d48ab0d675c341ab2c0084eafdc08df
16:24:03dom96D:
16:24:06dom96Recent change I guess
16:24:38GitDisc<treeform> does gcsafe mask the problem? or fix it?
16:24:47GitDisc<treeform> I am still accessing a global var without locks?
16:25:24dom96if you are accessing a global var then you should probably make it a {.threadvar.}
16:25:52GitDisc<treeform> I think I will just change the niv websockets lib to not use global vars
16:26:18GitDisc<treeform> it uses it for ping and pong, which could just be done in that async/greenlet what ever that thing is called.
16:26:37dom96oh, yeah, it definitely shouldn't need to use global vars
16:27:19GitDisc<treeform> but I will need touse global vars just make them with {.threadvar.}?
16:27:24dom96I created an issue with some things that should be changed in case you want to take care of them as well https://github.com/niv/websocket.nim/issues/1
16:27:27GitDisc<treeform> but I will need touse global vars just mark them with {.threadvar.}?
16:28:08dom96yeah, that would be ideal I think
16:28:22dom96That way the library should work when using multiple threads
16:29:00GitDisc<treeform> I still don't get how threads and async stuff interact, but I guess I will figure it out.
16:29:03dom96(or at least have a chance to, you'd still need to initialise that global var for each thread (which IMO should be done automatically by Nim... but that's another issue :)))
16:29:04GitDisc<treeform> Got to go, thanks!
16:32:41dom96Huh, I just looked up the latest techempower benchmarks and Jester is ahead of Crystal https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=json&l=82vf1y
16:34:00dom96oh, but they do no parallelisation
16:46:09FromGitter<Gooseus> ok, back kind of @Varriount @dom96 @Yardanico - so one thing I was thinking about was that it seems like you just control the event loop by calls to poll... so you'd have more control over the async flow by changing when the app defers to the event loop processing
16:46:27*gokr joined #nim
16:47:13miran_i'm browsing through issues to see if there is something i could solve...
16:47:26miran_this one looks like it can be closed? https://github.com/nim-lang/Nim/issues/6135 (cc dom96)
16:47:46*arecaceae quit (Remote host closed the connection)
16:47:56FromGitter<Gooseus> so I forked off of @Varriount example and added back the`while not c_prog: poll()` - https://gist.github.com/Gooseus/0ac36280d7e0420360d781058093f882 and the main difference I understand it is that my version opens the remote connection for each file before moving on to setting up the next connection
16:48:04*arecaceae joined #nim
16:49:21dom96miran_: seems like it
16:49:25FromGitter<Varriount> I doubt think you should be calling poll inside a coroutine. Again, I don't know if the async internals are reentrant
16:49:59FromGitter<Gooseus> really that progress flag is a hack because HttpClientBase doesn't make the `connected` public, or else I was thinking you'd be able to do `while not client.connected: poll()` wherever you wanted to waitFor the connection before moving on... not that I have specific use cases for this, but I imagine someone smart would
16:50:08dom96async internals aren't reentrant
16:50:12miran_dom96: 1 down, 1100 to go :)
16:50:27FromGitter<Gooseus> reentrant?
16:50:30dom96Technically nothing bad should happen if you call 'poll' within an async proc, but I would advise against it anyway
16:50:42dom96https://en.wikipedia.org/wiki/Reentrancy_(computing)
16:50:50dom96Wikipedia can explain it better than I can :)
16:51:14FromGitter<Gooseus> ya, I gotcha
16:52:28FromGitter<Yardanico> @Gooseus in this version you just store all futures and then wait for every one of them to complete
16:52:41FromGitter<Yardanico> so you don't need poll here
16:52:47FromGitter<Yardanico> it's actually rarely needed
16:53:18dom96Anybody want to help me write https://submission.fosdem.org/stands.php ? :) cc federico3
16:55:56FromGitter<Gooseus> right, you don't need it to just get from A to B, but I'm talking about the stuff in between... one thing I noticed was that while both versions had comparable times to finish that my version seemed to finish the earlier files first, which I assume is because file 1 is connected and partially downloading while each poll is running to connect the following files
16:56:53FromGitter<Yardanico> @Gooseus actually your first version is not async
16:57:12FromGitter<Gooseus> the first version I posted last night?
16:57:16FromGitter<Yardanico> yes
16:57:28FromGitter<Yardanico> because your poll() with while loop is blocking until request is done
16:57:39FromGitter<Yardanico> so basically there's no difference between sync and async in your version
16:57:41gokrfederico3: I would argue that your statement about erlang is false.
16:58:33gokrSee for example: http://highscalability.com/blog/2014/2/26/the-whatsapp-architecture-facebook-bought-for-19-billion.html
16:58:45FromGitter<Yardanico> @Gooseus well *technically* it still uses async selectors & stuff, but you get no benefits from async here
16:58:56FromGitter<Gooseus> @Yardanico well my latest version has the same thing and it should only poll until the first progress callback is called
16:59:36gokrdom96: Regarding competing with Elixir/Erlang/Phoenix - http://phoenixframework.org/blog/the-road-to-2-million-websocket-connections
17:00:22dom96gokr: fun :)
17:00:37dom96I'll be trying similar benchmarks
17:00:45dom96So thanks for the link
17:00:55gokrdom96: Further, Nim will never beat everyone at everything. Araq may make fun of Erlang/Elixir or whatever, but IMHO, that's not rooted in reality.
17:01:01federico3gokr: if you have evidence of erlang being widely used across very large services...
17:01:13gokrdom96: Note that they had to use a LOT of servers just to create that load.
17:01:42dom96Okay, maybe I'll be a bit less ambitious
17:01:43federico3and by all means, popularity is not a metric of quality.
17:01:45gokrfederico3: What do you mean? Isn't Pinterest, Whatsapp, Facebook messenger (or whatever it was), Klarna etc etc enough?
17:01:51federico3no
17:02:09gokrI have no idea what you mean.
17:02:27dom96hrm https://elixirforum.com/t/why-did-facebook-leave-erlang/2231
17:02:52FromGitter<Yardanico> https://www.quora.com/When-did-Facebook-switch-away-from-using-Erlang-for-Facebook-Chat-What-was-the-reason-for-it-What-did-they-replace-it-with
17:03:07FromGitter<Yardanico> "one server in the group would fail and cause cascading issues" same as with discord
17:03:19SunDwarfis quora really a reliable source
17:03:31dom96An FB employee is somewhat reliable
17:03:39FromGitter<mratsim> For technical questions you often get good answers
17:03:49federico3gokr: despite the hype, the use of C, C++, Java, even Go for *really* large service far outweights Erlang.
17:03:51SunDwarfoh its from an fb employee
17:03:51FromGitter<mratsim> for “opinions” well ...
17:03:57FromGitter<Gooseus> @Yardanico I definitely think I'm missing something with nim async stuff... cause runForever and waitFor all just run poll on different conditions. Is there some other pattern you need to use in order to make it truly async or something?
17:03:59SunDwarfi didnt even open the article because quora is 99% trash
17:03:59federico3but we should discuss is #nim-offtopic
17:04:36FromGitter<mratsim> I think scaling web services is pretty on topic. It’s not my domain but I find it interesting.
17:04:36dom96gokr: So my question is now, something which you might not be able to answer, but what are you doing that it requires the supposedly low-latency/high-throughput characteristics of Elixir?
17:04:58FromGitter<Yardanico> @Gooseus you don't need to use blocking wait for async futures, because this would destroy the whole point of async
17:04:59FromGitter<mratsim> chat server for a very popular game? ;)
17:05:32FromGitter<Yardanico> @Gooseus usually you have some main proc, and use waitFor mymainproc()
17:05:36FromGitter<Yardanico> and mymainproc is async
17:05:43FromGitter<Yardanico> and it's using "await" and "yield"
17:05:46FromGitter<Yardanico> or asyncCheck sometimes
17:05:50FromGitter<mratsim> or a Gitter/Discord/IRC/Twitch bridge in Nim :P
17:06:34federico3mratsim: more brid
17:06:58federico3(oops) more bridges between Matrix and other protocols would be really welcome
17:07:35PMunchCarrier pidgeon -> IRC bridge?
17:07:58FromGitter<Gooseus> @Yardanico right but calling mymainproc stops at whatever internal await/yield/asyncCheck until you pass the mymainproc return to a waitFor, right?
17:07:58SunDwarfyou could easy do that by just running irc over tcp/ac
17:08:16PMunchSunDwarf, haha good point :P
17:08:40PMunchBut I think a dedicated bridge would reduce the overhead
17:08:48FromGitter<Yardanico> @Gooseus I didn't quite undestood you, sorry
17:09:32FromGitter<Yardanico> it wouldn't stop it's executing at "yield" or "asyncCheck", it only would stop it's execution at "await", which literally means async wait (wait for some async proc to complete)
17:10:00FromGitter<Yardanico> and even if you have await in mymainproc, other async coroutines will still work (if you've called them via yield or asyncCheck)
17:12:04dom96PMunch: Now I know the topic for my next live stream :P
17:12:09dom96Can't wait to get pooped on
17:12:16PMunchHaha :P
17:12:26PMunchThat would be the best
17:14:57FromGitter<mratsim> by the way, is there any reason to use one way or the other when all the other part of the code will use the “ref object”? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Nim manual/tutorial uses the first version everywhere (?) but I don’t see the advantage when you never call NodeObj [https://gitter.im/nim-lang/Nim?at=59f0c691f7299e8f532fbdff]
17:15:54FromGitter<Gooseus> ok... so with regards to the asynchttpclient when you call the internal get methods (getContent), that is an async function and you get a future back that you would call waitFor on, but until you call waitFor the get method is stopped before it opens the remote connection and once you do, then main execution is stopped until that future completes after getting a full response back
17:15:56*ofelas joined #nim
17:15:59gokrdom96: The answer is basically that no, we don't really "need" the ultra low latency or scalability BUT we do want a good robust framework and runtime that a customer can accept as "ok, this is scalable stuff - we will not outgrow it".
17:16:16dom96gokr: fair enough
17:16:29gokrdom96: Also, I have fiddled with Phoenix and its really nice well thought out. Tons of RoR people are moving to Elixir/Phoenix.
17:16:40FromGitter<Yardanico> @Gooseus usually you would call "await" on it
17:16:47FromGitter<Yardanico> you almost never need waitFor in async procs
17:16:54FromGitter<Yardanico> because "await" is better than waitFor
17:17:19FromGitter<Yardanico> (for usage inside of async procs)
17:17:26FromGitter<Gooseus> if you never use waitFor, then when would the event loop ever execute?
17:17:29FromGitter<Yardanico> because it wouldn't block other coroutines
17:17:33dom96gokr: It does look well made and mature so I don't blame you at all.
17:17:35FromGitter<Yardanico> @Gooseus you use waitFor ONCE
17:17:38gokrdom96: One alternative is nodejs - but... it truly is a messy world. Not at all as "solid". And we still want expressiveness and relatively high productivity - so no, we aren't gonna use Go or something.
17:17:39FromGitter<Yardanico> to call your main proc
17:17:43dom96Just curious how we can improve.
17:17:52FromGitter<Yardanico> and everywhere else you use await/yield/asyncCheck
17:18:23dom96Sadly I don't think it will be me that creates the super awesome Nim web framework that everyone falls in love with.
17:18:36gokrdom96: I am with ya
17:18:41dom96I can't develop Nim's stdlib/nimble/etc and do that.
17:18:45FromGitter<Gooseus> so you basically queue up all your async routines and then start the machine once with waitFor and it susses out how everything is going to shake out?
17:18:55dom96So as much as I would love to I don't it's a good idea for me to start
17:19:10gokrdom96: I know. One thing I haven't really grokked is... why doesn't someone write a tight integration with Nginx?
17:19:12FromGitter<Yardanico> @Gooseus you don't queue them up
17:19:18FromGitter<Yardanico> everything is executed in order how you wrote it
17:19:30gokrdom96: Since a Nim+Nginx feels like a solid really fast single-box solution.
17:19:31dom96gokr: What do you mean by 'tight'?
17:19:32FromGitter<Yardanico> did you read docs here? https://nim-lang.org/docs/asyncdispatch.html
17:19:37FromGitter<Yardanico> at the start
17:19:42gokrdom96: Well, some kind of nginx module.
17:19:45FromGitter<Yardanico> it seems you should read them :)
17:20:10dom96gokr: I'd be curious to see how much of a performance boost that would give vs. the pain of dealing with that :)
17:20:42FromGitter<Yardanico> it would give us a VERY high performance boost, if done right
17:20:49FromGitter<Yardanico> nginx is extremely performant
17:20:56FromGitter<Gooseus> @Yardanico I have been reading through that page and the asyncdispatch.nim source trying to understand how it all works
17:21:14gokrdom96: Well, I can see that if Nim could show that "hey, look at this, 5x faster than nodejs" or whatever. And rock solid.
17:21:30dom96That is my plan currently
17:21:32*nsf joined #nim
17:21:43dom96Build a simple site for Jester with docs and some benchmarks
17:22:00FromGitter<Yardanico> @Araq, it seems we should edit our travis config according to https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received :)
17:22:02dom96somebody on HN mentioned that it would go a long way
17:22:13FromGitter<Gooseus> I think a diagram would probably help... because when I see doing multiple async operations at once and then waiting for both to finish in order to execute on those results it seems like the mechanism is to create a sequence of futures (like in the example) and then wait for each one in the sequence in order, right?
17:22:15dom96Yardanico: I don't think travis ever times out
17:22:27FromGitter<Yardanico> it does, if there's no output
17:22:29FromGitter<Yardanico> default is 10 mins
17:22:34FromGitter<Yardanico> new tester wouldn't echo any output
17:22:38FromGitter<Yardanico> because it runs in parallel
17:22:49dom96Gooseus: A bit lame of me to suggest this, but my book explains async with some nice diagrams
17:22:55FromGitter<Yardanico> (well it probably would do it in old "slow" mode, but not in the new one)
17:23:10FromGitter<Gooseus> I have the book and am pretty much on that chapter
17:23:23dom96awesome :)
17:23:31FromGitter<Gooseus> pretty good so far btw, nicely done @dom96 !
17:23:35dom96thanks!
17:23:47FromGitter<mratsim> (No one on this ?) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f0c8a332e080696e24a890]
17:23:56FromGitter<Yardanico> @mratsim post a question on the forum :)
17:24:12FromGitter<Yardanico> and it seems appveyor failed because of some real runtime error :)
17:24:22dom96mratsim: what's the problem?
17:24:32gokrdom96: gotta go, but I am all with ya ;)
17:24:38dom96Yardanico: what ever happened to your Gitter bridge?
17:24:51dom96gokr: Great :) See you
17:25:01FromGitter<Yardanico> dom96: what do you mean?
17:25:16FromGitter<mratsim> not a problem, in the manual and tutorial, I see the first form, but it you only refer to the “Node” ref object, wouldn’t it be simpler to just use the second one.
17:25:25dom96Yardanico: well there was an issue with httpclient which required a patch, did you create a PR?
17:26:08dom96mratsim: yep, feel free to change it. Believe it or not, it wasn't always possible to write 'ref object' :)
17:26:24FromGitter<mratsim> oh, mystery solved =)
17:27:52FromGitter<Yardanico> dom96: well I didn't make a PR yet, sorry. ⏎ also, about https://github.com/nim-lang/Nim/pull/6585 - the reason I asked is because it's just a wrapper, and wrappers mostly don't follow nim code style (even in this epoll wrapper constants are declared LIKE_THIS, but not LikeThis or likeThis).
17:28:25FromGitter<Gooseus> so the use case I'm thinking about is still the downloading a set of files from a remote server, performing some transformation on them and passing them to another remote location.... so if you imagine that the files are different sizes then the download would finish for each of them at different times. ⏎ Based on the example where you create a sequence of futures that you waitFor, if the future early in the sequence
17:28:25FromGitter... was large it would block the processing of the smaller files later in the sequence, right?
17:28:43FromGitter<Yardanico> @Gooseus you can have callbacks
17:28:47dom96Yardanico: yeah, that's fair, it just looked in particular weird to me so I changed it
17:28:55FromGitter<Varriount> @dom96 I would love it if we could get speeds comparable to Go's frameworks.
17:28:56FromGitter<Yardanico> well, I'm fine with it, just was curious
17:30:23SunDwarfgo is probably fast because it removes everything good
17:30:41GitDisc<GooRoo> like exceptions?
17:31:05SunDwarfaside from the gobashing, what made everyone standardize on 2-space indentation in nim
17:32:19dom96Araq came down from Heaven with a stone tablet, it read "Ye shall indent with 2 spaces"
17:32:30dom96:)
17:32:39SunDwarfim gonna be a rebel and use 3
17:32:48FromGitter<Yardanico> ohhh
17:32:53FromGitter<Gooseus> @Yardanico ok, so you'd have to use callbacks in that example... there isn't some other clever pattern? I mean, I'm used to callbacks for days, but was trying to do things different
17:32:56dom96I'm gonna write my own editor that allows me to use 3.14 spaces
17:33:05dom96Ultimate hipster
17:33:16FromGitter<Yardanico> why not 1/999801 spaces?
17:33:50SunDwarfdoes it use the new character encoding, utf-IEEE754
17:33:51FromGitter<Yardanico> (it's ~ 0.000_001_002_003_004_005_006_007)
17:34:09FromGitter<Yardanico> yes, WTF-IS-UTF encoding
17:34:14*claudiuinberlin joined #nim
17:34:18GitDisc<GooRoo> @dom96 using text for a code is too old-school-ish
17:34:27FromGitter<Yardanico> oh well... https://simonsapin.github.io/wtf-8/
17:34:42GitDisc<GooRoo> time to switch to AST-editing and stop discussions about number of spaces in indentation
17:34:51SunDwarfwhat is gitdisc
17:35:07FromGitter<Yardanico> bridge between discord and irc
17:35:13SunDwarfwow what
17:35:17SunDwarfwhere's the discord
17:35:18dom96GooRoo: It's all about VR these days https://media2.giphy.com/media/xebOoxouppcGs/giphy.gif :)
17:35:19FromGitter<Gooseus> where is the slack bridge?
17:35:24SunDwarfits my preferred chat platform
17:35:44FromGitter<Yardanico> https://discordapp.com/invite/ezDFDw2
17:35:58GitDisc<laura ☭> neat
17:36:11dom96Yardanico: Can you add Discord to our website?
17:36:21GitDisc<laura ☭> i feel like you totally could've used a webhook for the irc bot
17:36:30dom96Annoying thing about Slack is that there needs to be a special website for allowing people to join it...
17:36:32GitDisc<laura ☭> so that it changes name
17:36:50FromGitter<Yardanico> I didn't write my own Discord-IRC, I'm too lazy :P
17:38:32FromGitter<zacharycarter> lol that's a sweet VR simulation dom96
17:38:43GitDisc<laura ☭> oh god the default notifcation setting
17:38:59dom96zacharycarter: can you tell what movie it's from? :)
17:39:01FromGitter<Yardanico> laura: how do I change the default notification setting?
17:39:05FromGitter<Yardanico> IDK how to do it in discord really
17:39:10FromGitter<zacharycarter> I cannot
17:39:34dom96A clue: https://media0.giphy.com/media/Q2W4hziDOyzu0/giphy.gif
17:39:34GitDisc<laura ☭> Server Settings -> scroll down -> Only @mentions
17:39:43FromGitter<zacharycarter> hahaha hackers
17:39:45FromGitter<Gooseus> so I'm curious... is anyone actively working on an AWS SDK? I see this project, but it's a little barebones - https://github.com/aidansteele/aws_sdk.nim
17:39:49GitDisc<Yardanico> done
17:40:07GitDisc<laura ☭> tgabks
17:40:10GitDisc<laura ☭> thanks
17:40:18GitDisc<laura ☭> oh nice it triggers twice on edits
17:40:37dom96zacharycarter: best movie
17:40:53FromGitter<zacharycarter> dom96: hahaha it is pretty fantastic
17:40:55dom96yeah, that's actually something that FromGitter doesn't do
17:41:19FromGitter<Yardanico> (well this discord-irc bot is actually written in Go and has many backends, but tshhhhhh)
17:41:20FromGitter<Gooseus> Always Be Hacking Gibsons
17:41:21FromGitter<zacharycarter> @Gooseus : I'd chat with @Varriount - he's done some work on one
17:41:22*xet7 quit (Ping timeout: 258 seconds)
17:41:33dom96You gotta hack the Gibson!
17:42:13dom96Btw it's interesting to me how many people depend on the aws sdk
17:42:22dom96I've seen people that judge a language based on the availability of that package
17:42:36dom96I personally stay as far away as I can from AWS :P
17:43:34FromGitter<zacharycarter> Mostly enterprise affiliated folks
17:43:44FromGitter<zacharycarter> or people that love giving amazon their $
17:43:55FromGitter<zacharycarter> how else are you going to ☁️
17:44:03FromGitter<Gooseus> S3 is pretty awesome
17:44:23FromGitter<Yardanico> @zacharycarter free stuff from azure bizspark for sure
17:44:33*miran_ quit (Ping timeout: 248 seconds)
17:44:33FromGitter<Yardanico> (if you have a start-up :P)
17:44:51dom96Digital Ocean ftw
17:44:52FromGitter<Gooseus> I mean, they've got lots of awesome services... def a little evil empire, but they sure know how to create solutions man
17:45:04FromGitter<gokr> @dom96 kinda like openresty
17:45:45GitDisc<laura ☭> I prefer scaleway myself
17:45:53GitDisc<laura ☭> dirt cheap and pretty good specs
17:46:22FromGitter<Gooseus> but yeah, since universities aren't pumping out sys-admins enough sys-admins to make them good/cheap, most companies need AWS or similar
17:46:29dom96The reason I like to stay away from AWS is because from the times I've used it I could never be sure that they wouldn't charge me money
17:46:36FromGitter<Gooseus> so you need an AWS SDK if you want to get those companies to use nim at work
17:46:43dom96(when I was cancelling things for example)
17:47:29FromGitter<zacharycarter> well I think most companies need AWS / something similar because they don't want to host their own infrastructure
17:47:42FromGitter<Gooseus> yeah, AWS is not for hobbyists with no money, but for startups with capital that needs more than a simple server/app infrastructure they can't be beat
17:47:57FromGitter<zacharycarter> well that's not really true either
17:48:15FromGitter<zacharycarter> a lot of AWS services are dirt cheap
17:48:20*ryanhowe joined #nim
17:48:27FromGitter<zacharycarter> but their pricing is not the most transparent thing in the world as dom96 alluded to
17:48:42FromGitter<Gooseus> yeah, this is true, but you can def accidentally leave an instance running and find a bill waiting for you
17:48:52FromGitter<zacharycarter> sure
17:50:23FromGitter<Gooseus> but in any case, nim would benefit from having an aws sdk that is easy to use
17:50:44FromGitter<zacharycarter> I'd like to see a graphql SDK
17:50:49FromGitter<zacharycarter> then a AWS SDL
17:50:52FromGitter<zacharycarter> SDK*
17:52:06FromGitter<Gooseus> yeah, graphql is neat, but I think aws would get more attention
17:53:11GitDisc<treeform> nim AWS SDK would help me. Just an S3 uploader/downloader.
17:53:29FromGitter<Gooseus> I mean, I'm messing with this async file downloading thing specifically so I get something interfacing with S3... if I can do that then I can make a case for using nim for this one piece of my job
17:53:51*xet7 joined #nim
17:55:13FromGitter<Gooseus> <treeform> exactly, I mean if I can make something serviceable then I'll make a package from it, but I get the feeling a bunch of people in this channel could throw one together in an afternoon/evening
17:55:15GitDisc<treeform> What I did at my job is used nim to call the python downloader script in a system call. it works but not ideal.
17:55:45*ryanhowe quit (Quit: WeeChat 1.4)
17:57:34dom96Gooseus: please continue asking questions if you're unsure about something :)
17:58:34*miran_ joined #nim
18:00:11FromGitter<brentp> hi, I can do: `const lookup:array[117, int] = [1, 1, 1 ...]`. how can I do: `const lookup:array[117, uint64] = [1, 1, 1...]` ?
18:00:50FromGitter<brentp> the latter gives me `Error: type mismatch: got (array[0..116, int]) but expected 'array[0..116, uint64]'`
18:01:13*JappleAck joined #nim
18:02:15subsetparkbrentp - just cast your 1s to `uint64`
18:02:43FromGitter<brentp> each of them? :(
18:05:06FromGitter<brentp> well, that works. thanks
18:06:05FromGitter<Gooseus> oh, I will @dom96 , very much enjoying myself so far but feeling a little in over my head coming from mostly node/angular development for the last 5 years or so with just a sprinkling of python
18:06:41FromGitter<Yardanico> @brentp not each
18:06:52FromGitter<Yardanico> @brentp const lookup = [1'u64, 1, 1, 1....]
18:06:54FromGitter<Yardanico> try it like this
18:07:55dom96Gooseus: that's cool. Everyone has different experience, I don't recall seeing many people with your experience so do let us know how we can make our docs better
18:08:34FromGitter<brentp> @Yardanico . ok. will try that next time. I already generated the list with all the 'u64 suffixes
18:09:45FromGitter<Yardanico> better to try it right now :)
18:09:56FromGitter<Yardanico> because if you would make that in open-source, others will be shocked :P
18:11:17FromGitter<brentp> ok. you've shamed me into it. that works and looks nicer.
18:11:44FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/uIvX/back.png)
18:11:44FromGitter<Yardanico> remember that this world only with built-in types AFAIK
18:12:46FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/6dJV/front.png)
18:13:09FromGitter<zacharycarter> almost done with the high poly
18:20:11*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:21:34*onionhammer quit (Read error: Connection reset by peer)
18:26:27*claudiuinberlin joined #nim
18:34:34FromGitter<mratsim> @dom96, did the documentation PR: https://github.com/nim-lang/Nim/pull/6598
18:37:31*Snircle joined #nim
18:38:35*nsf quit (Quit: WeeChat 1.9)
18:40:57*Vladar quit (Quit: Leaving)
18:45:06FromGitter<Bennyelg> how can I do sometjing like this? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59f0dbb201110b7231fe019e]
18:48:27FromGitter<Bennyelg> db_postgres.DbConn*
18:50:38FromGitter<mratsim> I think it will work only if connection[T] is a base type or an enum
18:52:57*JappleAck quit (Ping timeout: 240 seconds)
18:54:46GitDisc<GooRoo> @dom96 and if someone sets up the special website for Slack invites, would it be enough to switch to it and get rid of IRC bridge? (just a reminder: Slack has built-in IRC support :))
18:55:19dom96I would want a bridge to here from Slack anyway
18:56:44GitDisc<GooRoo> then there is no sense 
18:57:19dom96why?
18:57:27dom96Some might like to access this channel via Slack
18:59:51GitDisc<GooRoo> 'cause it already looks like a shit with all this garbage added by bridges  https://habrastorage.org/webt/59/f0/de/59f0def156de7748687065.png
19:00:32*Viktor joined #nim
19:00:49dom96That's a bug in the bot that relays
19:01:02GitDisc<GooRoo> I know, but nevertheless
19:01:09GitDisc<GooRoo> it's kinda difficult sometimes to distinguish who writes what
19:01:31GitDisc<GooRoo> because all messages are sent by bot
19:03:04GitDisc<laura ☭> Not In Discord™
19:03:28GitDisc<laura ☭> you can use a webhook on the discord side and change the name to make a more seamless experience
19:03:57*kier quit (Ping timeout: 240 seconds)
19:05:54*JappleAck joined #nim
19:06:01dom96sounds like a perfect reason to rewrite this GitDisc bot in Nim ;)
19:06:27*Arrrr quit (Read error: Connection reset by peer)
19:06:50subsetpark...The fuck is GitDisc?
19:07:19GitDisc<GooRoo> dom96 meant Gitter <-> Discord bridge
19:08:10subsetparkHa, if you're writing a bridge between two bridges, good luck
19:08:19dom96So I'm trying to put the Nim crown on a t-shirt and it looks weird
19:08:28GitDisc<GooRoo> @laura ☭ yes, you can
19:08:28GitDisc<GooRoo> @dom96 and no, not a perfect reason 
19:09:04GitDisc<laura ☭> you coudl totally get the FromGitter user data and make it output better
19:09:34GitDisc<GooRoo> it's possible, but no one have enough motivation so far
19:10:02GitDisc<GooRoo> especially considering the fact that this Discord server was born couple of days ago
19:11:42GitDisc<GooRoo> @dom96 to make my point clear: it's not a perfect reason because there is no sense to re-write something just to make it implemented in another language
19:11:55GitDisc<GooRoo> if it's not about gaining experience
19:12:13GitDisc<GooRoo> Nim lacks other more important stuff and it's better to spend some time on it
19:12:26GitDisc<GooRoo> like websockets that were mentioned above
19:12:36*claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:14:26GitDisc<GooRoo> I would like to see websockets in stdlib. It can be not the best idea though, but at least it would be convenient
19:14:50dom96I agree, there are more important things to do.
19:14:58dom96But for some it would be a nice project
19:15:13dom96It would also be relatively easy
19:15:48*kier joined #nim
19:18:20*claudiuinberlin joined #nim
19:18:47GitDisc<GooRoo> I'm doing a relatively easy thing now. Hope to finish it soon
19:18:57GitDisc<GooRoo> in Nim of course
19:19:11shodan45subsetpark: watched your video. Nice!
19:19:23shodan45or at least I think that was you :D
19:19:47shodan45python <-> nim?
19:23:02subsetparkThat's me, man.
19:26:21*yay joined #nim
19:26:46dom96So, this is what I came up with. What do you guys think? https://teespring.com/en-GB/nimlang
19:28:58subsetparkwhat if you removed the NIM from the back?
19:29:27GitDisc<GooRoo> or at least the URL
19:30:10dom96hrm, to be honest I'm not sure I like the front. But it's difficult to design it any better than this :\
19:30:33dom96Maybe I should make it smaller
19:30:37dom96it feels too "in your face"
19:31:29GitDisc<GooRoo> just keep the position more or less the same. As it seems close to golden ratio 
19:32:36dom96heh
19:32:45dom96so you guys don't like the Nim in the back?
19:33:42*yglukhov joined #nim
19:33:43GitDisc<GooRoo> not really
19:37:06dom96Araq: Your thoughts? ^
19:37:25Araqdom96, huh? what's the topic
19:37:55dom96https://teespring.com/en-GB/nimlang
19:39:04*TjYoco joined #nim
19:40:25AraqI still like the older crown design better
19:40:30Araqwith the white in it
19:40:45Araqyeah and the back is weird
19:40:51*ipjk joined #nim
19:40:55dom96We can't mix our designs unfortunately
19:43:17subsetparkI feel like we only need NIM once; the crown looks cool (white or not), so i think it stands by itself on the back
19:43:48*Viktor quit (Quit: Viktor)
19:43:49subsetparkalso since the url is in a different font, it would look cleaner to avoid clashing typefaces
19:46:34GitDisc<GooRoo> BTW I also like the logo with white more
19:47:39*ofelas quit (Quit: shutdown -h now)
19:49:41*vlad1777d quit (Ping timeout: 240 seconds)
19:50:04*vlad1777d joined #nim
19:51:05*yglukhov quit (Ping timeout: 240 seconds)
19:54:12Araqagreed, the back can just be the crown
19:54:17*xet7_ joined #nim
19:54:35*xet7_ quit (Client Quit)
19:54:42dom96ugh, I can't reuse the same URL
19:54:56Araqand the url, well no. once upon a time I saw a shirt with "/usr/bin/perl"
19:55:08Araqand I thought "omg, lol, freak"
19:55:10AraqXD
19:56:08*Viktor joined #nim
19:56:37dom96well, here is just the front https://teespring.com/en-GB/nimlang1
19:56:41dom96With nothing at the back
19:56:52dom96I basically made it smaller
19:56:56*xet7bot joined #nim
19:57:47Araqcan you also change the logo?
19:58:05dom96Like I said, we shouldn't use the old logo
19:58:14dom96Branding needs to be the same everywhere :)
19:58:26dom96Pretty sure they teach that to marketing people
19:58:36Araqso throw away the new one
19:58:58dom96Too late for that
19:59:13dom96The website would look super bad with the old one too
20:00:12Araqok so throw away the marketing advice and make the shirt look awesome instead
20:01:15PMunchWhat, there are shirts now?!
20:01:24dom96I'm playing around with a design
20:01:41PMunchThat looks amazing
20:01:53subsetparkdom96: you don't like having a little crown on the back?
20:01:56FromGitter<data-man> Testing, please https://github.com/nim-lang/Nim/pull/6600
20:02:08PMunchDefinitely prefer the second one "nimlang1"
20:02:12Araqgotta show everyone your vice, PMunch
20:02:13dom96subsetpark: I do, just didn't put it there yet
20:02:20PMunchMy vice?
20:02:22subsetparkachso
20:02:23dom96You mean I should put this one? https://forum.nim-lang.org/images/logo.png
20:02:43Araqdata-man: YAY! better hashing :D
20:02:54PMunchI don't really use t-shirts a lot though..
20:02:56*Trustable quit (Remote host closed the connection)
20:03:05dom96PMunch: Hoodie? :)
20:03:07PMunchA coffee mug however would be amazing
20:03:16*yay quit (Quit: Textual IRC Client: www.textualapp.com)
20:03:16dom96Sure, we can get a coffee mug too
20:03:22PMunchWell, it's mostly shirts with me. And logos don't really go well on those :P
20:03:29dom96ahh :)
20:04:52dom96would be cool to get a 3D printed crown
20:04:59dom96Anyone good at 3D modelling?
20:05:11PMunchI could print you a basic one :P
20:05:20PMunchPretty shit at modelling though..
20:05:30dom96Araq: So is it that one that you had in mind?
20:05:46*ipjk quit (Read error: Connection reset by peer)
20:05:52Araqdom96, I think so
20:06:25*ipjk joined #nim
20:06:30dom96I think that will look super lame on a T-shirt :)
20:06:52dom96but if someone can find me a high res version of it I'll put it on to see
20:07:12*dom96 mostly bored of messing around with teespring now though
20:07:44GitDisc<GooRoo> @dom96 I guess I can handle 3D model, but only if it's really necessary
20:08:45dom96ahh, well, it would be nice to have a 3D recreation of the Nim crown
20:08:46FromGitter<gokr> Tshirt yeah!!
20:09:30FromGitter<gokr> What company are you using?
20:09:33Araqdom96, nim-lang/assets?
20:09:45dom96yeah, it's probably somewhere in there
20:10:03GitDisc<GooRoo> How came that Nim has the old logo and the new one? And since when? And why is the new one less bright? That's because of upcoming 1.0? :)
20:14:41dom96because it was modernized/flattenized :P
20:16:08Calinou<dom96> Anyone good at 3D modelling?
20:16:12CalinouI know some Blender, but am not really an artist :(
20:19:42FromGitter<Gooseus> oh man, merchandizing over here? 10 year old project and just making t-shirts now?
20:20:02subsetparkYeah, I'd use a coffee mug...
20:20:09FromGitter<Gooseus> stickers?
20:20:26FromGitter<Gooseus> don't the kids like to put them on their laptops these days?
20:22:20Calinoureminds me, I'm getting the Hacktoberfest shirt :P
20:22:27CalinouI have the 2016 one already, but the logo is barely visible
20:23:41*lastjedi joined #nim
20:23:51dom96I've bought stickers on stickermule
20:23:58FromGitter<Gooseus> regarding the t-shirt, I prefer the yellow crown on black... I think the nim on both sides and url is fine, you're obviously already a nerd. My suggestion would be to make the stuff on the front smaller cause it is a little in your face
20:24:02dom96and they had a store but they removed it :\
20:24:04dom96so I can't sell them on
20:25:14dom96So i'd have to buy them and then sell them and send them to people manually
20:28:53FromGitter<Gooseus> there isn't a place to make a sticker design online that people can buy like the t-shirts?
20:29:07FromGitter<gokr> https://www.discountmugs.com/category/custom-personalized-ceramic-coffee-mugs/
20:29:10dom96maybe, I'll need to look into it
20:29:16PMunchHmm, how can I list the files in a folder in Nim?
20:29:42dom96walkDir/walkFiles
20:29:58FromGitter<Gooseus> ok, I thought you had when you were talking about stickermule stopping something... I'll take a look while I'm curious
20:31:11PMunchgokr, there you need to buy them and ship them manually though
20:31:17PMunchWhat we really want is drop-shipping
20:32:19PMunchdom96, "pattern is OS dependent" :( I just want to get all files in a folder
20:32:47dom96walkFiles("yourDir"), no need to use a pattern
20:34:53FromGitter<Gooseus> (https://files.gitter.im/nim-lang/Nim/S0HT/image.png)
20:35:06PMunchAah okay
20:35:17dom96hah
20:35:28FromGitter<Gooseus> they figured me out quick over at teespring... looks like they also sell stickers in their store, can you not make them as well?
20:35:42PMunchHaha, I get them as well
20:35:46PMunchAre these public?
20:35:59dom96yep
20:36:13PMunchSo I can buy one right now?
20:37:30dom96yep
20:37:34dom96:)
20:37:41PMunchDone
20:37:48dom96but beware, I have no idea what it will end up like
20:38:03PMunchHaha, no worries
20:38:11PMunchCool to have none the less
20:38:17dom96but hrm
20:38:23dom96you might want the one with the nim logo at the back as well
20:38:28dom96I dunno, up to you
20:38:31PMunchIn the back?
20:38:37zolk3rilol latin kings
20:39:03PMunchOh, the one with bigger print has a thing in the back..
20:39:13PMunchI prefer the smaller logo though
20:39:14FromGitter<Gooseus> $.02 cheaper to go for the one without the logo on the back...
20:39:21dom96PMunch: yeah, but I will make another one
20:39:30dom96With the same size logo at front but small crown at the back
20:40:31FromGitter<Gooseus> what is the origin of the crown logo? just something cool or is related to the biblical king Nimrod?
20:41:07*miran_ quit (Ping timeout: 252 seconds)
20:41:34*firstjedi joined #nim
20:42:03*firstjedi quit (Max SendQ exceeded)
20:43:13PMunchWe should get this bad-boy on a shirt as well: https://github.com/nim-lang/assets/blob/master/Art/mascot.svg
20:43:54dom96lol, that's too scary :)
20:44:06dom96We need a cute honey badger
20:44:13PMunchI think it's cool :P But yeah, I know that it's deprecated
20:45:22*lastjedi quit (Ping timeout: 258 seconds)
20:45:47dom96definitely cool :)
20:48:02PMunchIs there a way to define --app:libs and --noMain as pragmas?
20:48:17PMunchSame way you can do {.passL:"whatever".}
20:58:43PMunchNo one?
20:59:49dom96no idea
21:00:02PMunchHmm, that's annoying..
21:00:44dom96here is the other design https://teespring.com/en-GB/nimlang2
21:01:01dom96I think i'll keep both
21:01:12skrylari just hope 2.0 isn't full of stupid
21:01:21skrylar1.0 is pleasant
21:01:24PMunchHmm, can I have a pragma in an imported module?
21:01:40skrylar{.push.}?
21:02:16PMunchI mean I want to put {.pragma: rtl, exportc, dynlib, cdecl.} in an import, so I can do {.rtl.} on procs where I import it
21:02:39gokr140 people, nice
21:03:02dom96So I shall share https://teespring.com/en-GB/nimlang2 and https://teespring.com/en-GB/nimlang1 :)
21:03:39skrylarPMunch, https://nim-lang.org/docs/manual.html#pragmas-pragma-pragma
21:04:31PMunchYeah I know I can use it, I was wondering if they can be placed in an import
21:05:22PMunchApparently not
21:05:41PMunchInclude works though, obviously
21:06:44skrylarwell include is textual inclusion
21:06:58*derlafff quit (Ping timeout: 255 seconds)
21:07:05*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
21:07:06skrylarimport is symbolic, why would you be able to modify that which was already compiled
21:08:13PMunchYeah I know
21:08:32PMunchimport is using AST though isn't it?
21:08:49PMunchSo it would be entirely possible to have imported pragmas
21:09:26skrylarsounds like it would make pragmas complicated :\
21:09:36FromGitter<gokr> Regarding AWS - my opinion is that for most of us, it's way too complicated and expensive. When we prepaid servers a year in advance - then we managed to match say Upcloud in price. But... in practice, Upcloud (just my current favorite) feels much faster, much easier to manage and I only pay for what I need. And don't need to prepay.
21:09:38FromGitter<mratsim> write your own import macros? :P
21:10:00skrylarwell. i guess pragmas already have to contend with fully qualified names, because macros can be invoked as pragmas, so
21:10:04FromGitter<gokr> Then there have historically been areas in the world where only AWS was the option - like Brazil.
21:11:02*TjYoco quit (Quit: Leaving)
21:11:10skrylari guess the syntax would be {.pragma: rtl*, ...}
21:17:24dom96PMunch: What should I put on the mug? :)
21:17:34dom96Just the crown and text?
21:17:40PMunchYeah
21:17:41dom96maybe some code on the back?
21:17:54dom96Maybe in the future, for now just crown and text
21:18:29*Viktor quit (Quit: Viktor)
21:18:31PMunchWell, I'm a minimalist. But a little, slightly faded code snippet could be cool.
21:18:48PMunchI think I'd prefer the crown and text only though
21:21:16PMunchPhew, got the whole dynamic loading thing working: https://github.com/h3rald/min/pull/8
21:22:25PMunchGot 3/4 PRs down for hacktober now
21:22:29PMunchJust one more..
21:22:36dom96So I was going to do some coding tonight, instead I created Nim t-shirts and mugs. Hope it was worth it :)
21:22:54PMunchI'll definitely get one of each
21:22:57PMunch:)
21:23:29dom96Seems I broke teespring https://teespring.com/en-GB/nimlang_mug
21:23:31PMunchOh well, I'm off to bed now. Maybe my last PR will be for jester
21:23:37*vlad1777d quit (Ping timeout: 255 seconds)
21:24:19PMunchHmm, I can select all but the black one..
21:24:29PMunchOr, I can select it. But it doesn't show
21:25:02dom96yeah, that's what I mean
21:25:04dom96It's broken :\
21:25:15PMunchWhat happens if I buy one?
21:25:23*nsf joined #nim
21:25:34dom96You'll get missingno on your mug :D
21:25:43PMunchHaha, that could be cool :P
21:25:55PMunchOh well, I'll wait 'till tomorrow
21:26:00PMunchGood night
21:26:01*PMunch quit (Quit: leaving)
21:31:09dom96Seems to be fixed now
21:32:01*ipjk quit (Ping timeout: 240 seconds)
21:32:28GitDisc<GooRoo> @dom96 try t-shirt with the old logo please, just to compare
21:32:34Araq"No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself."
21:32:36Araq:-(
21:33:32gokrfederico3: So you don't consider Whatsapp to be a large service?
21:39:34*Viktor_ joined #nim
21:41:15*Viktor_ quit (Client Quit)
21:41:38GitDisc<GooRoo> @gokr, if WhatsApp guys were able to create something good with Erlang, it doesn't necessarily mean that someone else will be able too. And doesn't mean that Erlang (or Elixir) is the best language for such kind of applications.
21:42:43gokrI never claimed Erlang/Elixir is "the best language for such kind of applications". But I do claim there is enough evidence around to not diss it.
21:42:54gokrIt's uneducated and silly to do that.
21:43:19FromGitter<dom96> (https://files.gitter.im/nim-lang/Nim/u0fs/Screen-Shot-2017-10-25-at-22.42.24.png)
21:43:23FromGitter<dom96> @GooRoo ^
21:43:57gokrI am just annoyed with people who can't appreciate a "good thing" just because it's not their favorite.
21:44:33AraqI never meant to "diss" Erlang, it's an impressive piece of technology
21:45:10Araqyou're however in #nim here and Nim targets C and C++, I'm not suddenly gonna target the Erlang VM just because "omg, it SCALES"
21:45:26gokrI never said you should - someone else said so.
21:45:33GitDisc<GooRoo> @gokr, well, I like the ideas behind it too: lightweight processes, hot code swapping, “let it crash”, etc.
21:46:13gokrAraq: And I do know your view, I was more reacting to others.
21:46:26Araqhttps://news.ycombinator.com/item?id=10028227 here they argue Erlang would be even better on the JVM, fwiw
21:46:59GitDisc<GooRoo> @dom96, thanks! Much better now. But need some “glow” effect
21:47:03gokrWell, who knows. BEAM isn't fast for "crunching". But AFAIK it has very finely tuned network parts.
21:47:30*derlafff joined #nim
21:48:35gokrAraq: Just to make it clear - I never said Nim should target BEAM. I am not even sure Nim should even try competing in this area.
21:48:59*NimBot joined #nim
21:49:00Araq"Scalability and large actor counts aren't the definitive features of Erlang, though. It's supervision trees, the distribution protocol, the OTP framework, the primacy of tuples and lists as your main and highly flexible data types, a great pattern matching engine for binary formats and regular Erlang terms alike, module-level hotswapping, a crash-only programming model, the ability to have external programs benefit from Erlang semantics via external nodes
21:49:00Araqand ports, so on and so forth." -- would be nice if somebody spoon-fed these to me one day ;-)
21:49:43*Viktor_ joined #nim
21:52:19GitDisc<GooRoo> Erlang's pattern matching for binary formats is nice indeed
21:52:37FromGitter<GULPF> is there a way to make this compile without warnings? https://play.nim-lang.org/?gist=73e65281c958aa6c6c08a11376db9460 ⏎ compiler complains that `bar` isn't gcsafe because `fWrap` contains GC'd memory, but in practice fWrap is immutable so it shouldn't matter? I don't know much about gc safety
21:54:28Araqimmutability is irrelevant for the GC
21:55:00FromGitter<data-man> I want to change some functions for parsing numbers. ⏎ ⏎ Current | New ⏎ -------|------- ⏎ proc parseInt | parseInt*T: SomeSignedInt (s: string, number: var T, start: T = 0; maxLen = 0): int ... [https://gitter.im/nim-lang/Nim?at=59f10833b20c64242949ec01]
21:55:42FromGitter<data-man> Oops, markdown broken :(
22:00:14*elrood quit (Quit: Leaving)
22:01:12*gokr quit (Read error: Connection reset by peer)
22:02:14*dddddd quit (Remote host closed the connection)
22:02:38federico3gokr: I can reply on #nim-offtopic if you want to join
22:04:02FromGitter<GULPF> @Araq ok. is there a way to do what I'm trying to do? that is, having a global containing procs which is accessed from a {.gcsafe.} proc. I know about {.threadvar.}, but it doesn't support let variables.
22:09:38*gokr joined #nim
22:10:51*ipjk joined #nim
22:14:27*Viktor_ quit (Quit: Viktor_)
22:18:00*onionhammer joined #nim
22:41:09*sleepyqt quit (Quit: Leaving)
22:45:19*nsf quit (Quit: WeeChat 1.9)
22:54:05*JappleAck quit (Quit: Leaving)
22:57:02FromGitter<Varriount> @dom96 I'd go for a Nim shirt with the crown on the left or right breast, where a pocket might otherwise be.
22:57:38dom96I was thinking that
22:57:39dom96might try that
22:58:37FromGitter<Varriount> @GULPF What about constants?
23:12:15*martinium joined #nim
23:34:33*xet7bot quit (Quit: quit)
23:39:30*libman joined #nim
23:56:25joshbaptistelooking for an online algo "schooly" site that supports nim