<< 16-03-2017 >>

00:24:29*gangstacat quit (Ping timeout: 240 seconds)
00:28:50*girvo joined #nim
00:33:22*girvo quit (Ping timeout: 240 seconds)
00:43:27*arnetheduck joined #nim
01:06:57*rauss joined #nim
01:11:10*brson quit (Quit: leaving)
02:29:44*girvo joined #nim
02:33:42*PMunch quit (Quit: leaving)
02:34:13*girvo quit (Ping timeout: 256 seconds)
02:38:49*def-pri-pub quit (Quit: leaving)
02:45:31*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:57:27*Jesin quit (Ping timeout: 256 seconds)
02:58:24*kulelu88 quit (Quit: Leaving)
02:58:31*lenstr joined #nim
03:00:49*chemist69 quit (Ping timeout: 258 seconds)
03:01:00*libman quit (Quit: Connection closed for inactivity)
03:14:43*chemist69 joined #nim
03:25:13*MonsterAbyss quit (Ping timeout: 256 seconds)
03:27:32*MonsterAbyss joined #nim
03:31:08*ftsf_ quit (Ping timeout: 246 seconds)
03:49:46*ftsf_ joined #nim
04:16:51*vlad1777d quit (Remote host closed the connection)
04:17:01*vendethiel joined #nim
04:17:21*vendethiel- quit (Ping timeout: 260 seconds)
04:30:32*girvo joined #nim
04:34:49*girvo quit (Ping timeout: 240 seconds)
04:54:59*girvo joined #nim
04:55:19*vendethiel quit (Ping timeout: 256 seconds)
04:59:02*vendethiel joined #nim
04:59:41*ftsf_ quit (Ping timeout: 246 seconds)
05:03:52*Vladar joined #nim
05:47:32*vlad1777d joined #nim
06:08:11*rauss quit (Quit: WeeChat 1.7)
06:13:23*ftsf_ joined #nim
06:41:38*nsf joined #nim
06:51:18FromGitter<vegansk> Check this out, Nim can be Haskell :-) https://gist.github.com/vegansk/0f10dd63177725bb64e359dd06fe0910
06:53:47*FromGitter * dustinlacewell is too stupid to appreciate
06:54:21Araqnice, can you post this on the forum too?
06:54:30Araqquite impressive
06:55:59FromGitter<vegansk> @Araq, ok :-) Btw, please review https://github.com/nim-lang/Nim/pull/5547
06:57:39Araqlol?
06:57:57Araqwhat kind of patch is that? "dunno why it can raise, shut up"
07:00:41FromGitter<vegansk> I wrote about the reason here: https://github.com/nim-lang/Nim/issues/5546
07:01:07FromGitter<vegansk> And it's only targets the console handler
07:07:03Araqwhat why
07:07:18Araqif you don't have stdout, don't call the console logger
07:08:29*tautologico quit (Ping timeout: 240 seconds)
07:08:38Araqsecondly your commit message doesn't refer to this issue
07:08:49*tankfeeder quit (Quit: Leaving)
07:08:49*tautologico joined #nim
07:08:52Araqthirdly you seem to do 'except IOError'
07:09:48Araqforthly what about checking isatty() or whatever that stream abstraction leaking thing is called
07:10:05*tankfeeder joined #nim
07:18:30*gokr joined #nim
07:24:47*rokups joined #nim
07:34:45*vendethiel quit (Ping timeout: 260 seconds)
07:35:47*ftsf_ quit (Quit: :q!)
07:40:40FromGitter<vegansk> @Araq, I guess we can't use *isatty because it requires valid file descriptor and calls invalid parameter handler otherwise, see this comment: https://msdn.microsoft.com/en-us/library/f4s0ddew.aspx#Anchor*2
07:43:45FromGitter<vegansk> And I can't know if my process attached to stdout or not. My app can be used as windows service (no stdout), standalone app (has stdout), or can be launched by another app with or without stdout.
07:48:23*shashlick quit (Ping timeout: 246 seconds)
07:49:23*shashlick joined #nim
08:08:15Araqhttps://msdn.microsoft.com/de-de/library/windows/desktop/ms683175(v=vs.85).aspx
08:18:35FromGitter<vegansk> @Araq, what about stdout redirection?
08:19:00Araqmeh
08:22:06*gokr quit (Ping timeout: 240 seconds)
08:22:59*Arrrr joined #nim
08:32:48*Andris_zbx joined #nim
08:32:55*xmonader left #nim ("Leaving")
08:37:06*couven92 joined #nim
09:05:26*cheatfate_ is now known as cheatfate
09:50:05*girvo_ joined #nim
09:52:09*girvo quit (Ping timeout: 240 seconds)
09:59:38*girvo_ quit (Ping timeout: 246 seconds)
10:03:27FromGitter<Varriount> How do applications such as Python work? On Windows I've been able to launch such processes with no attached console window and no output handles, and they still work.
10:17:39FromGitter<vegansk> @Varriount, the problem is that if stdout is invalid, this line will throw an error: https://github.com/nim-lang/Nim/blob/5b5bd3811b5f6e7841128527cb098b23b373e7a6/lib/system/sysio.nim#L82
10:19:21FromGitter<vegansk> I guess that python stdlib doesn't throw an exception if it can't write to stdout. And Nim's stdlib has the same behaviour some time ago
10:20:48FromGitter<andreaferretti> I clearly recall having to pay attention when using `print` for django applications with apache python module, because it triggered a crash (because of missing stdout)
10:35:30FromGitter<vegansk> Found the solution for isatty: https://github.com/c9/node-gnu-tools/blob/master/grep-src/lib/isatty.c
10:41:04FromGitter<vegansk> @Araq, I close #5547, will fix isatty in terminal.nim
11:02:25*Snircle joined #nim
11:04:45*djellemah_ quit (Ping timeout: 260 seconds)
11:06:04*couven92 quit (Quit: Client disconnecting)
11:10:59FromGitter<vegansk> Cool workaround via setjmp/longjmp :-( https://github.com/c9/node-gnu-tools/blob/master/grep-src/lib/msvc-inval.h#L174
11:27:18Araqvegansk: just keep the try ... except solution then, but check for 'except IOError'
11:27:26Araqand only for the console logger.
11:31:02*couven92 joined #nim
11:43:11*bjz joined #nim
11:44:53tstmAraq: If I wanted to use sdl2 on the web, should I use the method https://hookrace.net/blog/porting-nes-go-nim/ this guy used and just compile everything with emscripten?
11:45:54AraqI have no idea.
11:46:15tstmHeh, ok. =)
11:49:30cheatfatetstm, `this guy` is actually `def-` ask him
11:49:55tstmAh. :P
11:50:19*PMunch joined #nim
11:52:54*djellemah joined #nim
12:26:33def-tstm: would be good to get it working with the new webassembly stuff and make sure that the GC works
12:26:44def-tstm: and sound never worked for me
12:27:01def-tstm: otherwise that would be a reasonable way forward if you really want SDL2, a compiled language and web
12:28:15*gokr joined #nim
12:28:42tstmdef-: Yeah, both sound like pretty important things to get working. :P
12:28:56tstmgc and sound I mean
12:30:27*couven92 quit (Quit: Leaving)
12:32:45*gokr quit (Ping timeout: 258 seconds)
12:33:06FromGitter<Almynic> hi guys i get a illegal storage access in my minimal app:
12:33:13*benoliver999 quit (Changing host)
12:33:13*benoliver999 joined #nim
12:36:28*elrood joined #nim
12:38:59FromGitter<andreaferretti> `removeYearSequence` returns `nil` if there is no year in the filename
12:39:47FromGitter<Almynic> ok thanks, stupid mistake i'm new to nim ;)
12:40:22FromGitter<andreaferretti> is there something that works like `spawn` but always runs in a new thread?
12:40:50FromGitter<andreaferretti> `spawn` is prone to deadlock when one exceeds the threadpool size
12:41:06FromGitter<andreaferretti> but it is convienient, unlike the `thread` module which is more low level
12:41:26FromGitter<andreaferretti> it can return values, and run functions with more than one argument
12:41:29*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:47:22Araqandreaferretti: just increase the thread pool size
12:48:26FromGitter<andreaferretti> I don't know statically the number of threads that are needed
12:48:35FromGitter<andreaferretti> also, I see that there is a hard limit of 256
12:49:02Araqin fact, copy&paste&edit threadpool.nim, I like your idea.
12:49:17Araqonce you have something that works, share it with us please.
12:49:25FromGitter<andreaferretti> ok, I will try that and see what I come up with
12:50:39*gokr joined #nim
12:57:32*PMunch quit (Quit: leaving)
13:09:48*couven92 joined #nim
13:18:07*mjanssen joined #nim
14:11:08*smt_ joined #nim
14:13:04*Jesin joined #nim
14:14:12*PMunch joined #nim
14:15:09*smt quit (Ping timeout: 260 seconds)
14:15:49demi-dom96: i am planning on redoing my website tech stack with jester + my static page generator; i may have some questions for you, but based on the docs it seems pretty clear
14:20:40*gangstacat joined #nim
14:29:42cheatfatedemi-, just be sure dont make jester frontend server, put it behind nginx/apache or anything else you trust
14:30:06*rauss joined #nim
14:30:39demi-yeah, i'm going to try putting it behind nginx. I'm currently using apache with static html pages i generate with a nim program. but the overhead of maintaining the apache configs is a bit too high, so i want to try with jester and nginx instead
14:31:41demi-i'm going to put the whole thing in a open source repo as i do it so it can be used as a basic tutorial/example of how it can be done
14:32:09*SusWombat quit (Ping timeout: 240 seconds)
14:33:56*gokr quit (Quit: Leaving.)
14:44:00*SusWombat joined #nim
14:46:59*nsf quit (Quit: WeeChat 1.7)
14:48:31SusWombatVladar, I cant use shaders with the sdl2 2d rendering api right? id need something like sdl-gpu?
14:52:27VladarSusWombat, I haven't seen any shader-related stuff in the core SDL2 API
14:52:49*bjz joined #nim
15:04:43*antranigv joined #nim
15:04:56antranigvhey all!
15:04:59antranigvhow's it going?
15:13:33ldleworkhorribly. thanks for reminding me.
15:27:31couven92Hmm... linter for nim?
15:28:06couven92So that Araq doesn't need to complain about style on PRs? :P
15:28:28*PMunch quit (Quit: leaving)
15:29:46*couven92 quit (Quit: Client disconnecting)
15:29:51demi-it would be nice to have something point out potential issues in code with the identifier naming rules
15:50:27*couven92 joined #nim
15:51:29couven92@demi- write one? :P
15:52:07demi-i'm already working on too many things
15:53:08couven92I feel you... I should probably continue writing my MSc... :/
15:54:54*tankfeeder quit (Quit: Leaving)
15:55:34subsetparkLinter is a nice project idea - I've also been thinking about writing a Quickcheck library
15:56:54couven92Create a nimlint nimble or integrate into compiler?
15:58:28*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
15:58:50couven92Or maybe we should call it nlint! :P
16:00:03demi-it might be better to make it a separate program, since the compiler already has a syntax validator feature, whereas this is stylistic
16:00:58couven92Agreed, and I think nimlint would be a better name even though it's longer
16:06:15*couven92 quit (Quit: Bye)
16:11:50*couven92 joined #nim
16:11:58SusWombatIs it hard to write a linter?
16:12:21couven92It's a lot of AST checking I'd imagine
16:12:43SusWombatI thought about a tool that transforms codestyles so anyone can write in the style he wants. that would be in a simmiliar direction right?
16:14:06couven92SusWombat, transforming codestyles is inherently dangerous! A LOT of thing can go wrong there
16:14:28SusWombatbut its not immpossible right?
16:15:02couven92The fact that no other language has such a tool, suggest that it might be
16:15:48couven92(correction: No other language that I know of and which is a general purpose language like Nim)
16:16:50SusWombathttps://github.com/TheSavior/ESLint-Formatter
16:16:56*brson joined #nim
16:17:28euantorGo has gofmt
16:17:34couven92SusWombat, that's formatting (correcting/optimizing/aligning) indentation
16:18:17SusWombatokay
16:19:04couven92SusWombat, the closest I know to what you suggest, is the Code Suggestion functionality in Roslyn for C#/F# and VB.NET
16:20:51*smt_ quit (Ping timeout: 240 seconds)
16:21:01couven92Technically still a (very powerful) Linter that has built-in manual resolution. And manual resolution is very important since you sometimes need things to be just the way you do it for some interoperability reasons, et al.
16:23:05couven92But back to `nimlint`, I guess we could have a look at `pylint`, `eslint`, etc. and see if it difficult to write `nimlint`
16:23:40*djellemah quit (Read error: Connection reset by peer)
16:26:29ldleworkNim can't have a template that generated a template right?
16:26:38ldleworkBecause its single phase compilation?
16:26:42ldleworkor two-phase or whatever?
16:26:46ldleworkits not regressive
16:32:52*Senketsu joined #nim
16:37:46Araqldlework: there is no such limitation.
16:38:52AraqSusWombat: be my guest 'nim pretty' was something in this direction but it's abandoned
16:39:05SusWombat:(
16:39:39Araqno, not :(, that's a :) because the base technology exists
16:40:04Araqand it's not exactly trivial to write.
16:40:47SusWombatThe thing is im a complete noob so as it seems like its a hard task its very unlikely i could do/continue it
16:43:03ArrrrA question, shouldn't a for loop create a new scope? Right now, i can't do the following: http://pastebin.com/J6emSzwm
16:43:46Arrrrwould be consistent with redefining proc args
16:47:21*Trustable joined #nim
16:52:10FromGitter<vegansk> @Araq, now it handles only IOError for console logger
16:52:42AraqArrrr: that has come up before. I agree.
16:52:55Araqvegansk: alright
16:56:21*arnetheduck quit (Ping timeout: 240 seconds)
17:03:35AraqSusWombat: I can guide you
17:04:04dom96I would really love to see a nimlint
17:04:34*dom96 isn't sure about the difference between linting and formatting
17:05:09dom96demi-: That's brilliant. I should have some time soon to give Jester some much needed love so you should benefit from that :)
17:05:49demi-dom96: not sure if you saw my other comments but i plan to write up and open source the whole process of the setup
17:06:18dom96demi-: That's great as well :)
17:13:50SusWombatAraq, i still think im not "experienced" enough to do that but id like to look at the code anyway where would i find it?
17:15:09*Sentreen quit (Ping timeout: 240 seconds)
17:20:18AraqSusWombat: nim/compiler/nimfix directory
17:24:29SusWombatk thx :) but yeah seems to be over my head
17:28:24*Sentreen joined #nim
17:29:56SusWombative never done anything with a lexer or ast before that might be why
17:30:09*Andris_zbx quit (Remote host closed the connection)
17:30:50demi-Araq: i had a question about the logger module, when using a file logger, it doesn't seem to write out to disk automatically so when the program terminates unexpectedly, due to assert or whatever -- the log isn't available on disk to review. is there a design reason behind this behavior or some way i can get it to be written out as it goes so that data can be collected?
17:32:23dom96demi-: The reason is efficiency, there was an issue for this recently IIRC
17:32:49dom96https://github.com/nim-lang/Nim/pull/5424
17:33:28demi-when my program is crashing i want the data more than i care about efficiency, on hardware these days that shouldn't be costing a measurable difference in perf
17:34:14SusWombatDoes any other editor have integrations for nim like the one for vscode? or is vscode the best integration?
17:34:28*couven92 quit (Ping timeout: 240 seconds)
17:35:10*tankfeeder joined #nim
17:36:17SentreenIs there any way to get a mutable seq out of a table? I'm trying to do something like: `var myseq = table[someKey]`, where modifications to myseq modify the seq in the table, but as far as I understand it the seq inside the table is just copied over?
17:36:54euantorSusWombat: Sublime text does, emacs does, and others. See: https://github.com/nim-lang/Nim/wiki/Editor-Support
17:38:09demi-Sentreen: edit it in place?
17:40:37dom96demi-: Maybe Araq has some other reasons, but I agree with you.
17:40:50SentreenDo you mean copy it over, modify it and copy it back? or `table[somekey][2] = somevalue`? The first seems pretty expensive since I'll be doing it a lot. The second is how I'm doing it now, but it's rather annoying, since I need to basically modify it three times :/
17:40:54dom96Sentreen: use mget("key")
17:41:08SusWombateuantor, yeah but i mean like really nicely integrated like doc when cursor is over the function, completion for imported modules, showing me at what "proc argument" im currently at and so on
17:41:39euantorI think VS Code is widely regarded as one of the best at the minute
17:51:10SusWombateuantor, ok ty
17:51:41*couven92 joined #nim
17:55:40FromGitter<Varriount> dom96: I still think something like getVar or mutableGet would have been better than mget
17:56:27dom96Varriount: I don't :)
17:56:43Sentreenmget seems to be deprecated though :)
17:56:56dom96oh
17:57:07SentreenIt's not working for me though, so I must be doing something wrong anyway :p
17:57:29dom96I should have read your question properly
17:57:38*nsf joined #nim
17:57:57dom96The only way you can achieve that AFAIK is to create a sorta hacky alias: template myseq = table[someKey]
17:57:58*couven92 quit (Ping timeout: 240 seconds)
17:59:44SentreenAh dang, I was hoping to get access to the actual pointer to the seq, since I basically need to fetch it (or create a fresh one), modify it , write it back and read it again
18:00:20SentreenBut thanks for the help, I thought it was possible, so I would have been stuck for hours trying to make it possible
18:01:11dom96Well. If you want an *unsafe* pointer you can do: addr table[someKey]
18:01:41dom96But whether you should do that depends on what you are actually trying to do
18:07:32Sentreenhmmm, nothing else will be modifying that piece of memory concurrently. And it's all local to a single function. So I think it should be okay
18:07:34SentreenI'll give it a try
18:07:37Sentreenthanks again!
18:18:37*smt joined #nim
18:21:33*ofelas joined #nim
18:33:31*pie__ joined #nim
18:39:33*Trustable quit (Remote host closed the connection)
18:55:43*couven92 joined #nim
18:59:50Araqdemi-, dom96 errors are flushed, hints and warnings are not. not necessarily to disk though because flushFile() is not sqlite.
19:02:28*couven92 quit (Ping timeout: 240 seconds)
19:05:07*Jesin quit (Quit: brb)
19:13:03*Jesin joined #nim
19:17:32*zachcarter joined #nim
19:30:30demi-not sure if i follow why the sqlite thing is relevant?
19:31:15Araqits source code shows what it takes to get a reliable "write to disk"
19:31:20Araqon multiple OSes
19:31:35AraqOSes made it a tough problem.
19:33:10FromGitter<rsirres> do you plan to include a compression method (e.g. zip) in the standard library ?
19:34:00*nsf quit (Quit: WeeChat 1.7)
19:39:42zachcarterThis is not a nim quesiton directly, but I’m hoping someone with experience with the android ndk and Nim might be able to help me out
19:40:18zachcarterI keep running into this error when trying to run ndk-build : jni/src/stdlib_os.c:8:25: fatal error: mach-o/dyld.h: No such file or directory
19:42:15FromGitter<Varriount> Hm. Isn't mach-o the kernel Mac OSX is built on?
19:42:44zachcarteryeah
19:42:52zachcarterI’m trying to do this on a macbook pro
19:43:06FromGitter<Varriount> If stdlib_os.c is a nim-generated file, you might want to check that the Nim compiler is targeting android instead.
19:43:18zachcarterit is a nim-generated file
19:43:21zachcarterhmm okay
19:43:25zachcarteris there a way to force that Varriount?
19:43:35zachcarterI”m doing -d:android
19:43:40FromGitter<Varriount> I believe --os:linux should work
19:43:40zachcarterI’m*
19:43:44zachcarterokay thanks
19:44:04zachcarterbtw - haven’t talked in a while, hope all is well :D
19:44:20FromGitter<Varriount> The problem is, how should the compiler handle operating systems VS variants.
19:44:43FromGitter<Varriount> Using defines works, however you don't get much sanity checking.
19:44:57FromGitter<Varriount> zachcarter: Are you still using bgfx?
19:45:07zachcarterI’m up in the air about it
19:45:11zachcarterI wrote my own bindings to it, which are working
19:45:46zachcarterbut I’m wondering if it’s worth it over just using OpenGL ES since it’s another dependency users wil lhave to install etc
19:45:59zachcarterwhat do you think Varriount?
19:47:04FromGitter<Varriount> Well, dependencies can always be embedded. Major Python libraries do it all the time (for example, the AWS API library boto3 embeds the HTTP library 'requests')
19:47:56FromGitter<Varriount> I'd say it depends on what you feel comfortable with. After looking at bgfx, it seemed that the big advantage to using it was greater cross-platform capability.
19:48:23zachcarterI agree
19:48:42zachcarterI’m trying to put together a little android prototype iwth it at the moment
19:48:55zachcarterbtw I got past that error with your suggestion :)
19:49:55FromGitter<Varriount> zachcarter: Again, using a define (-d:android) on a system for which it makes no sense (OSX) throws no error.
19:50:09zachcarterright
19:50:23stisaDid you try --os:android ?
19:50:26FromGitter<Varriount> Although now that I think about it, one could always add (in system.nim) a sanity check.
19:50:29zachcarterI didn't
19:51:48FromGitter<Varriount> Hrm, https://nim-lang.org/docs/nimc.html doesn't list the operating systems/architectures supported by respective arguments.
19:59:35demi-dom96: can i have jester run "daemonized" automatically?
19:59:44*couven92 joined #nim
20:05:58*couven92 quit (Ping timeout: 240 seconds)
20:15:58FromGitter<ivankoster> hey could someone look at my last post in https://forum.nim-lang.org/t/2848 ? I'm having trouble modelling the one_of construct from google protobuf in Nim
20:16:52FromGitter<ivankoster> I cooked something up but afraid its not gonna work
20:20:22stisaivankoster: that looks similar to a variant object https://nim-lang.org/docs/manual.html#types-object-variants
20:20:56def-demi-: that's usually something better left to the OS: https://en.wikipedia.org/wiki/Operating_system_service_management
20:23:01FromGitter<ivankoster> @stisa I think the variant object cannot change their kind once instantiated? The protobuf spec is really flexible and the kind changes everytime you assign one of the fields in the union
20:26:55FromGitter<rsirres> How would you package/bundle a bunch of static files in nim ?
20:27:55def-rsirres: put them in a directory and distribute it with the exe?
20:28:07stisaivankoster: looks like they can: https://glot.io/snippets/eo1wvm6mcg
20:28:30def-if you want a single executable, read them in at compile-time, but not really worth it in most cases
20:32:12FromGitter<Varriount> @stisa I believe you must 'reset' the object: https://nim-lang.org/docs/system.html#reset,T
20:34:54*Arrrr quit (Quit: Leaving.)
20:35:54*bjz joined #nim
20:37:29dom96demi-: what def- said. Usually you would create a systemd/upstart/whatever service for it
20:37:45dom96(or you can run it in screen but that's a poor man's solution :))
20:38:26Calinouhi dom96 :)
20:38:34Calinouwriting a systemd service is very easy, yeah
20:38:43Calinouhowever, it doesn't seem to restart on crash automatically by default :/
20:39:07XeCalinou: Restart=always
20:39:14CalinouXe: thanks, I'll try that
20:39:17Xeadd that under [Service]
20:39:17Calinouuseful for my game servers
20:39:20Xeit's what i use in prod
20:39:20Calinouwhich can be crash-happy sometimes
20:42:14*rokups quit (Quit: Connection closed for inactivity)
20:43:42FromGitter<ivankoster> @Varriount @stisa I think you are right varriount, see https://glot.io/snippets/eo1xbu314r ⏎ Does this also work as an union, as in those variables per variant are overlayed in memory?
20:44:30FromGitter<Varriount> @ivankoster Yes, however it's not exactly like a C union. The kind/variant indicator is stored in the object.
20:45:40FromGitter<ivankoster> thats ok i think. protobuf mainly uses this for memory saving in messages that are sent over the network, and you always have to send which kind is used anyway
20:45:59FromGitter<Varriount> That is, the "A" type in your snippet will contain a "kind" member in the underlying data type.
20:46:28*tankfeeder quit (Quit: Leaving)
20:46:30FromGitter<Varriount> You'll still probably have to do some translation between Nim types and any native types.
20:47:44*couven92 joined #nim
20:49:09FromGitter<ivankoster> i probably also have to overload the dot operator for assignment somehow, because their semantics is that ⏎ ⏎ ```an.adata = 1 ⏎ an.bdata = "2"``` ⏎ ⏎ should be possible and the kind changes everytime you assign one of the variant specific variables [https://gitter.im/nim-lang/Nim?at=58cafa44fe6a638b1ad2b7ae]
20:51:07FromGitter<ivankoster> damn thats probably not possible? i mean the dot operator can be used for both reading and writing and only writing should change the kind :/
20:53:34FromGitter<rsirres> @def I think you are right. It is probably better to put them simply in a directory
20:53:58*couven92 quit (Ping timeout: 240 seconds)
20:56:44zachcarterCan anyone explain to me the gap or space nimx is trying to fill?
20:57:01zachcarteris it a GUI solution or a windowing solution?
20:57:42*tdc joined #nim
20:58:00zachcarterit uses an OpenGL context to my knowledge - is there access to that context? I can’t figure out if it’s a solution meant for building games or if it’s meant to be a solution for building GUI applications or both?
20:58:07zachcarterand if it’s the latter that’s kind of a weird space
21:01:09*tdc quit (Remote host closed the connection)
21:05:08*rauss quit (Quit: WeeChat 1.7)
21:05:28FromGitter<Varriount> zachcarter: Well, the github page says that its a gui library.
21:05:34*bozaloshtsh quit (Quit: ok)
21:05:40zachcarteryeah but he’s using it in his game engine rod
21:05:50zachcarterfor like windowing and creating the opengl context and for the editor etc
21:05:59zachcarterit seems like a cludge
21:06:13zachcarterkuldge*
21:06:14zachcarterwhatever
21:06:16*bozaloshtsh joined #nim
21:06:16*bozaloshtsh quit (Changing host)
21:06:16*bozaloshtsh joined #nim
21:07:06zachcarteror maybe it’s just a bit higher level than what I think it should be?
21:14:26FromGitter<stisa> @ivankoster something like this? https://glot.io/snippets/eo1y4va5n2 I don't think a common proc for reading from data is possible tough
21:22:19*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:34:02FromGitter<Varriount> zachcarter: Higher level, I think.
21:34:13FromGitter<Varriount> Given that it has to work with Javascript
21:34:36zachcarterhmm I hadn’t thought about that
21:35:16FromGitter<ivankoster> @stisa that looks really cool but it relies a lot on the names adata and bdata both containing 'data'. I cannot control the names people will use in their .proto files. From your example i tried it like this: https://glot.io/snippets/eo1yrl4rgg ⏎ But that crashes, it seems the operator overload is not used :(
21:38:16FromGitter<Varriount> @ivankoster You can overload the '.' operator: https://nim-lang.org/docs/manual.html#special-operators
21:41:13dom96If somebody has some time to submit a Nim talk to PolyConf, please do so: https://forum.nim-lang.org/t/2867
21:41:23FromGitter<Almynic> does anyone uses travis ci for nim projects? what is the easiest way to get started?
21:44:35dom96Also, I updated NEP1 because I was getting annoyed seeing it recommend the ``type`` keyword on the same line as the type declaration: https://nim-lang.org/docs/nep1.html
21:47:17AraqAlmynic: Nim itself uses travis, checkout its .travis.yml file
21:48:25FromGitter<Almynic> ok will try to read that file, to figure how to setup ci for nim, thanks
21:49:23antranigvguys are there any changes in the language for the last 6 months?
21:49:48dom96almy
21:49:57dom96oops. Almynic: https://github.com/nim-lang/Nim/wiki/BuildServices
21:52:42*couven92 joined #nim
21:53:59*bjz joined #nim
21:57:15*nsf joined #nim
21:58:58*couven92 quit (Ping timeout: 240 seconds)
22:00:23*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:12:13*Vladar quit (Quit: Leaving)
22:13:57FromGitter<ivankoster> @Varriount Ah nice, that works good for assignments: https://glot.io/snippets/eo1zpc8n1f ⏎ I can make some nice macros to expand to something like that. ⏎ How would you do the return value of the field access overload though in my snippet? ⏎ The returned field can either be int or string, but a strong typing says it can only be one [https://gitter.im/nim-lang/Nim?at=58cb0e240b2625d064894c00]
22:28:07*elrood quit (Quit: Leaving)
22:32:13ldlework#nim I'm trying to impress some people
22:32:34ldleworkSomeone snap out a little template/macro that memoizes an arbitrary block of code
22:32:41ldleworkI guess that's kind of ill-defined?
22:34:58*shashlick quit (Ping timeout: 258 seconds)
22:35:38*shashlick joined #nim
22:35:54*Serenitor joined #nim
22:41:01*def-pri-pub joined #nim
22:41:10Serenitorhm, there's nothing in nim that translates pretty much 1:1 to union, is there?
22:43:30FromGitter<ivankoster> there is a union pragma to turn object into a C union
22:44:01FromGitter<ivankoster> manual says that it cannot be used with garbage collected values inside then union though
22:44:13dom96ldlework: could this be what you want? https://github.com/andreaferretti/memo
22:44:49ldleworkdom96: for arbitrary blocks!
22:44:50ldlework:(
22:45:07ldleworklike a python with: statement that only runs the code once and then memoizes what variables changed
22:45:13ldleworkand just always sets them to those values
22:45:46dom96sounds like a fun nim metaprogramming exercise for you to try :P
22:46:38ldleworkhaha I doubt I have a working nim
22:46:55*nsf quit (Quit: WeeChat 1.7)
22:48:38dom96Why wouldn't you?
22:57:26ldleworkBecause I'm a liar
22:57:33ldleworkI'm writing my own docker based package manager
22:57:39ldleworkobviously I have dockerized nim
22:57:44*couven92 joined #nim
22:57:55ldleworkthanks to whoever is maintaining that
22:58:01ldleworkdom96: did you see my video?
22:58:24ldleworkdom96: I hate to say this, but I was able to use C# to connect to a unix socket and talk http to my docker daemon
22:58:29ldleworkusing mono
22:58:38ldleworkI actually laughed out loud
22:58:44ldleworkits just a cruel irony you know
22:58:56ldleworkdom96: https://s3-us-west-2.amazonaws.com/converterpoint-2/encodings/579b289bae8bd123c25ad8bef0c0623b.webm
23:01:02Serenitor@ivankoster thx I think I found a solution for my case
23:03:58*couven92 quit (Ping timeout: 240 seconds)
23:08:03dom96ldlework: All I can do is encourage you to be more comfortable diving into Nim's standard library
23:08:50dom96Why does Docker use HTTP btw?
23:09:06ldleworkdom96: because it offers a remote API
23:09:12ldleworkyou can controller docker hosts from afar
23:09:18ldleworkhttp is pretty standard.
23:09:41dom96I see.
23:15:03FromGitter<ivankoster> Argh.. Is there some form of pattern matching to make this compile? https://glot.io/snippets/eo21id1cee ⏎ That protobuf one_of feature is a pain in my ass :smile:
23:15:07*couven92 joined #nim
23:15:51*couven92 quit (Client Quit)
23:16:36dom96bah, glot.io really needs to make their code window bigger
23:19:50dom96ivankoster: https://gist.github.com/dom96/bd41d8464b9880d4506f89ecc187f119
23:20:07dom96You can do something like this, not sure if that helps
23:22:18ldleworkmaybe my video will be more interesting if I install nim and nimble, install a nimble package, and then compile a binary using the nimble package
23:22:25ldlework:)
23:24:36dom96'night
23:39:10zachcarterdebugging nim + android is difficult
23:39:19zachcarterhell the ndk is difficult
23:39:29zachcarterI don’t know what type of environment to use / how to get gdbserver into my apk
23:40:36*xet7 quit (Ping timeout: 240 seconds)
23:42:45FromGitter<Varriount> zachcarter: I applaud you for even trying. NDK documentation is really sparse.
23:43:03zachcarterto say the least
23:43:24zachcarterI’ve at least got an apk compiling, it’s just crashing to the homescreen
23:43:35zachcarterand it doesn’t help the AVD I’m running is spamming logcat with nonsense errors
23:46:20demi-NDK is awful, a lot of the android tooling is fucking awful
23:46:24zachcarteragreed
23:46:58zachcarterit doesn’t help there isn’t a good C/C++ IDE
23:47:04zachcarterCLion is the closest thing we have I think
23:47:21zachcarterbut it’s still a pain in the ass as it doesn’t integrate fully with android
23:47:27FromGitter<Varriount> @Serenitor Nim has a {.union.} to turn a type into a C-like union, however it has limitations.
23:47:43FromGitter<Varriount> *{.union.} pragma
23:48:00zachcarterlike gd android studio supports c/c++ code and clion supports ndk-gdb but neither provide a straightforward format for creating a project with mixed sources
23:48:13zachcarterso frustrating
23:48:21zachcarterand the notion that jetbrains is going to produce kotlin native lol...
23:48:36zachcartercan’t even streamline this tooling
23:54:56*ldlework is now known as MuslimZionist
23:56:32*MuslimZionist is now known as ldlework
23:58:52FromGitter<ivankoster> @dom96 Yeah, that that works, thanks. Unfortunately users can do things like assign int to a string field and the compiler won't complain because it's determining at runtime to which field you're actually assigning. This why I was wondering if there is compile time pattern matching, so the compiler can actually check the types.