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:18 | FromGitter | <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:21 | Araq | nice, can you post this on the forum too? |
06:54:30 | Araq | quite impressive |
06:55:59 | FromGitter | <vegansk> @Araq, ok :-) Btw, please review https://github.com/nim-lang/Nim/pull/5547 |
06:57:39 | Araq | lol? |
06:57:57 | Araq | what kind of patch is that? "dunno why it can raise, shut up" |
07:00:41 | FromGitter | <vegansk> I wrote about the reason here: https://github.com/nim-lang/Nim/issues/5546 |
07:01:07 | FromGitter | <vegansk> And it's only targets the console handler |
07:07:03 | Araq | what why |
07:07:18 | Araq | if you don't have stdout, don't call the console logger |
07:08:29 | * | tautologico quit (Ping timeout: 240 seconds) |
07:08:38 | Araq | secondly your commit message doesn't refer to this issue |
07:08:49 | * | tankfeeder quit (Quit: Leaving) |
07:08:49 | * | tautologico joined #nim |
07:08:52 | Araq | thirdly you seem to do 'except IOError' |
07:09:48 | Araq | forthly 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:40 | FromGitter | <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:45 | FromGitter | <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:15 | Araq | https://msdn.microsoft.com/de-de/library/windows/desktop/ms683175(v=vs.85).aspx |
08:18:35 | FromGitter | <vegansk> @Araq, what about stdout redirection? |
08:19:00 | Araq | meh |
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:27 | FromGitter | <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:39 | FromGitter | <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:21 | FromGitter | <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:48 | FromGitter | <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:30 | FromGitter | <vegansk> Found the solution for isatty: https://github.com/c9/node-gnu-tools/blob/master/grep-src/lib/isatty.c |
10:41:04 | FromGitter | <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:59 | FromGitter | <vegansk> Cool workaround via setjmp/longjmp :-( https://github.com/c9/node-gnu-tools/blob/master/grep-src/lib/msvc-inval.h#L174 |
11:27:18 | Araq | vegansk: just keep the try ... except solution then, but check for 'except IOError' |
11:27:26 | Araq | and only for the console logger. |
11:31:02 | * | couven92 joined #nim |
11:43:11 | * | bjz joined #nim |
11:44:53 | tstm | Araq: 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:54 | Araq | I have no idea. |
11:46:15 | tstm | Heh, ok. =) |
11:49:30 | cheatfate | tstm, `this guy` is actually `def-` ask him |
11:49:55 | tstm | Ah. :P |
11:50:19 | * | PMunch joined #nim |
11:52:54 | * | djellemah joined #nim |
12:26:33 | def- | tstm: would be good to get it working with the new webassembly stuff and make sure that the GC works |
12:26:44 | def- | tstm: and sound never worked for me |
12:27:01 | def- | 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:42 | tstm | def-: Yeah, both sound like pretty important things to get working. :P |
12:28:56 | tstm | gc and sound I mean |
12:30:27 | * | couven92 quit (Quit: Leaving) |
12:32:45 | * | gokr quit (Ping timeout: 258 seconds) |
12:33:06 | FromGitter | <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:59 | FromGitter | <andreaferretti> `removeYearSequence` returns `nil` if there is no year in the filename |
12:39:47 | FromGitter | <Almynic> ok thanks, stupid mistake i'm new to nim ;) |
12:40:22 | FromGitter | <andreaferretti> is there something that works like `spawn` but always runs in a new thread? |
12:40:50 | FromGitter | <andreaferretti> `spawn` is prone to deadlock when one exceeds the threadpool size |
12:41:06 | FromGitter | <andreaferretti> but it is convienient, unlike the `thread` module which is more low level |
12:41:26 | FromGitter | <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:22 | Araq | andreaferretti: just increase the thread pool size |
12:48:26 | FromGitter | <andreaferretti> I don't know statically the number of threads that are needed |
12:48:35 | FromGitter | <andreaferretti> also, I see that there is a hard limit of 256 |
12:49:02 | Araq | in fact, copy&paste&edit threadpool.nim, I like your idea. |
12:49:17 | Araq | once you have something that works, share it with us please. |
12:49:25 | FromGitter | <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:49 | demi- | 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:42 | cheatfate | demi-, 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:39 | demi- | 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:41 | demi- | 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:31 | SusWombat | Vladar, I cant use shaders with the sdl2 2d rendering api right? id need something like sdl-gpu? |
14:52:27 | Vladar | SusWombat, 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:56 | antranigv | hey all! |
15:04:59 | antranigv | how's it going? |
15:13:33 | ldlework | horribly. thanks for reminding me. |
15:27:31 | couven92 | Hmm... linter for nim? |
15:28:06 | couven92 | So 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:51 | demi- | 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:29 | couven92 | @demi- write one? :P |
15:52:07 | demi- | i'm already working on too many things |
15:53:08 | couven92 | I feel you... I should probably continue writing my MSc... :/ |
15:54:54 | * | tankfeeder quit (Quit: Leaving) |
15:55:34 | subsetpark | Linter is a nice project idea - I've also been thinking about writing a Quickcheck library |
15:56:54 | couven92 | Create a nimlint nimble or integrate into compiler? |
15:58:28 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
15:58:50 | couven92 | Or maybe we should call it nlint! :P |
16:00:03 | demi- | 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:58 | couven92 | Agreed, 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:58 | SusWombat | Is it hard to write a linter? |
16:12:21 | couven92 | It's a lot of AST checking I'd imagine |
16:12:43 | SusWombat | I 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:06 | couven92 | SusWombat, transforming codestyles is inherently dangerous! A LOT of thing can go wrong there |
16:14:28 | SusWombat | but its not immpossible right? |
16:15:02 | couven92 | The fact that no other language has such a tool, suggest that it might be |
16:15:48 | couven92 | (correction: No other language that I know of and which is a general purpose language like Nim) |
16:16:50 | SusWombat | https://github.com/TheSavior/ESLint-Formatter |
16:16:56 | * | brson joined #nim |
16:17:28 | euantor | Go has gofmt |
16:17:34 | couven92 | SusWombat, that's formatting (correcting/optimizing/aligning) indentation |
16:18:17 | SusWombat | okay |
16:19:04 | couven92 | SusWombat, 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:01 | couven92 | Technically 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:05 | couven92 | But 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:29 | ldlework | Nim can't have a template that generated a template right? |
16:26:38 | ldlework | Because its single phase compilation? |
16:26:42 | ldlework | or two-phase or whatever? |
16:26:46 | ldlework | its not regressive |
16:32:52 | * | Senketsu joined #nim |
16:37:46 | Araq | ldlework: there is no such limitation. |
16:38:52 | Araq | SusWombat: be my guest 'nim pretty' was something in this direction but it's abandoned |
16:39:05 | SusWombat | :( |
16:39:39 | Araq | no, not :(, that's a :) because the base technology exists |
16:40:04 | Araq | and it's not exactly trivial to write. |
16:40:47 | SusWombat | The 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:03 | Arrrr | A question, shouldn't a for loop create a new scope? Right now, i can't do the following: http://pastebin.com/J6emSzwm |
16:43:46 | Arrrr | would be consistent with redefining proc args |
16:47:21 | * | Trustable joined #nim |
16:52:10 | FromGitter | <vegansk> @Araq, now it handles only IOError for console logger |
16:52:42 | Araq | Arrrr: that has come up before. I agree. |
16:52:55 | Araq | vegansk: alright |
16:56:21 | * | arnetheduck quit (Ping timeout: 240 seconds) |
17:03:35 | Araq | SusWombat: I can guide you |
17:04:04 | dom96 | I would really love to see a nimlint |
17:04:34 | * | dom96 isn't sure about the difference between linting and formatting |
17:05:09 | dom96 | demi-: That's brilliant. I should have some time soon to give Jester some much needed love so you should benefit from that :) |
17:05:49 | demi- | 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:18 | dom96 | demi-: That's great as well :) |
17:13:50 | SusWombat | Araq, 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:18 | Araq | SusWombat: nim/compiler/nimfix directory |
17:24:29 | SusWombat | k thx :) but yeah seems to be over my head |
17:28:24 | * | Sentreen joined #nim |
17:29:56 | SusWombat | ive 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:50 | demi- | 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:23 | dom96 | demi-: The reason is efficiency, there was an issue for this recently IIRC |
17:32:49 | dom96 | https://github.com/nim-lang/Nim/pull/5424 |
17:33:28 | demi- | 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:14 | SusWombat | Does 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:17 | Sentreen | Is 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:54 | euantor | SusWombat: Sublime text does, emacs does, and others. See: https://github.com/nim-lang/Nim/wiki/Editor-Support |
17:38:09 | demi- | Sentreen: edit it in place? |
17:40:37 | dom96 | demi-: Maybe Araq has some other reasons, but I agree with you. |
17:40:50 | Sentreen | Do 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:54 | dom96 | Sentreen: use mget("key") |
17:41:08 | SusWombat | euantor, 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:39 | euantor | I think VS Code is widely regarded as one of the best at the minute |
17:51:10 | SusWombat | euantor, ok ty |
17:51:41 | * | couven92 joined #nim |
17:55:40 | FromGitter | <Varriount> dom96: I still think something like getVar or mutableGet would have been better than mget |
17:56:27 | dom96 | Varriount: I don't :) |
17:56:43 | Sentreen | mget seems to be deprecated though :) |
17:56:56 | dom96 | oh |
17:57:07 | Sentreen | It's not working for me though, so I must be doing something wrong anyway :p |
17:57:29 | dom96 | I should have read your question properly |
17:57:38 | * | nsf joined #nim |
17:57:57 | dom96 | The 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:44 | Sentreen | Ah 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:20 | Sentreen | But thanks for the help, I thought it was possible, so I would have been stuck for hours trying to make it possible |
18:01:11 | dom96 | Well. If you want an *unsafe* pointer you can do: addr table[someKey] |
18:01:41 | dom96 | But whether you should do that depends on what you are actually trying to do |
18:07:32 | Sentreen | hmmm, 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:34 | Sentreen | I'll give it a try |
18:07:37 | Sentreen | thanks 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:50 | Araq | demi-, 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:30 | demi- | not sure if i follow why the sqlite thing is relevant? |
19:31:15 | Araq | its source code shows what it takes to get a reliable "write to disk" |
19:31:20 | Araq | on multiple OSes |
19:31:35 | Araq | OSes made it a tough problem. |
19:33:10 | FromGitter | <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:42 | zachcarter | This 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:18 | zachcarter | I 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:15 | FromGitter | <Varriount> Hm. Isn't mach-o the kernel Mac OSX is built on? |
19:42:44 | zachcarter | yeah |
19:42:52 | zachcarter | I’m trying to do this on a macbook pro |
19:43:06 | FromGitter | <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:18 | zachcarter | it is a nim-generated file |
19:43:21 | zachcarter | hmm okay |
19:43:25 | zachcarter | is there a way to force that Varriount? |
19:43:35 | zachcarter | I”m doing -d:android |
19:43:40 | FromGitter | <Varriount> I believe --os:linux should work |
19:43:40 | zachcarter | I’m* |
19:43:44 | zachcarter | okay thanks |
19:44:04 | zachcarter | btw - haven’t talked in a while, hope all is well :D |
19:44:20 | FromGitter | <Varriount> The problem is, how should the compiler handle operating systems VS variants. |
19:44:43 | FromGitter | <Varriount> Using defines works, however you don't get much sanity checking. |
19:44:57 | FromGitter | <Varriount> zachcarter: Are you still using bgfx? |
19:45:07 | zachcarter | I’m up in the air about it |
19:45:11 | zachcarter | I wrote my own bindings to it, which are working |
19:45:46 | zachcarter | but 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:59 | zachcarter | what do you think Varriount? |
19:47:04 | FromGitter | <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:56 | FromGitter | <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:23 | zachcarter | I agree |
19:48:42 | zachcarter | I’m trying to put together a little android prototype iwth it at the moment |
19:48:55 | zachcarter | btw I got past that error with your suggestion :) |
19:49:55 | FromGitter | <Varriount> zachcarter: Again, using a define (-d:android) on a system for which it makes no sense (OSX) throws no error. |
19:50:09 | zachcarter | right |
19:50:23 | stisa | Did you try --os:android ? |
19:50:26 | FromGitter | <Varriount> Although now that I think about it, one could always add (in system.nim) a sanity check. |
19:50:29 | zachcarter | I didn't |
19:51:48 | FromGitter | <Varriount> Hrm, https://nim-lang.org/docs/nimc.html doesn't list the operating systems/architectures supported by respective arguments. |
19:59:35 | demi- | 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:58 | FromGitter | <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:52 | FromGitter | <ivankoster> I cooked something up but afraid its not gonna work |
20:20:22 | stisa | ivankoster: that looks similar to a variant object https://nim-lang.org/docs/manual.html#types-object-variants |
20:20:56 | def- | demi-: that's usually something better left to the OS: https://en.wikipedia.org/wiki/Operating_system_service_management |
20:23:01 | FromGitter | <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:55 | FromGitter | <rsirres> How would you package/bundle a bunch of static files in nim ? |
20:27:55 | def- | rsirres: put them in a directory and distribute it with the exe? |
20:28:07 | stisa | ivankoster: looks like they can: https://glot.io/snippets/eo1wvm6mcg |
20:28:30 | def- | if you want a single executable, read them in at compile-time, but not really worth it in most cases |
20:32:12 | FromGitter | <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:29 | dom96 | demi-: what def- said. Usually you would create a systemd/upstart/whatever service for it |
20:37:45 | dom96 | (or you can run it in screen but that's a poor man's solution :)) |
20:38:26 | Calinou | hi dom96 :) |
20:38:34 | Calinou | writing a systemd service is very easy, yeah |
20:38:43 | Calinou | however, it doesn't seem to restart on crash automatically by default :/ |
20:39:07 | Xe | Calinou: Restart=always |
20:39:14 | Calinou | Xe: thanks, I'll try that |
20:39:17 | Xe | add that under [Service] |
20:39:17 | Calinou | useful for my game servers |
20:39:20 | Xe | it's what i use in prod |
20:39:20 | Calinou | which can be crash-happy sometimes |
20:42:14 | * | rokups quit (Quit: Connection closed for inactivity) |
20:43:42 | FromGitter | <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:30 | FromGitter | <Varriount> @ivankoster Yes, however it's not exactly like a C union. The kind/variant indicator is stored in the object. |
20:45:40 | FromGitter | <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:59 | FromGitter | <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:30 | FromGitter | <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:09 | FromGitter | <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:07 | FromGitter | <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:34 | FromGitter | <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:44 | zachcarter | Can anyone explain to me the gap or space nimx is trying to fill? |
20:57:01 | zachcarter | is it a GUI solution or a windowing solution? |
20:57:42 | * | tdc joined #nim |
20:58:00 | zachcarter | it 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:07 | zachcarter | and 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:28 | FromGitter | <Varriount> zachcarter: Well, the github page says that its a gui library. |
21:05:34 | * | bozaloshtsh quit (Quit: ok) |
21:05:40 | zachcarter | yeah but he’s using it in his game engine rod |
21:05:50 | zachcarter | for like windowing and creating the opengl context and for the editor etc |
21:05:59 | zachcarter | it seems like a cludge |
21:06:13 | zachcarter | kuldge* |
21:06:14 | zachcarter | whatever |
21:06:16 | * | bozaloshtsh joined #nim |
21:06:16 | * | bozaloshtsh quit (Changing host) |
21:06:16 | * | bozaloshtsh joined #nim |
21:07:06 | zachcarter | or maybe it’s just a bit higher level than what I think it should be? |
21:14:26 | FromGitter | <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:02 | FromGitter | <Varriount> zachcarter: Higher level, I think. |
21:34:13 | FromGitter | <Varriount> Given that it has to work with Javascript |
21:34:36 | zachcarter | hmm I hadn’t thought about that |
21:35:16 | FromGitter | <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:16 | FromGitter | <Varriount> @ivankoster You can overload the '.' operator: https://nim-lang.org/docs/manual.html#special-operators |
21:41:13 | dom96 | If somebody has some time to submit a Nim talk to PolyConf, please do so: https://forum.nim-lang.org/t/2867 |
21:41:23 | FromGitter | <Almynic> does anyone uses travis ci for nim projects? what is the easiest way to get started? |
21:44:35 | dom96 | Also, 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:17 | Araq | Almynic: Nim itself uses travis, checkout its .travis.yml file |
21:48:25 | FromGitter | <Almynic> ok will try to read that file, to figure how to setup ci for nim, thanks |
21:49:23 | antranigv | guys are there any changes in the language for the last 6 months? |
21:49:48 | dom96 | almy |
21:49:57 | dom96 | oops. 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:57 | FromGitter | <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:13 | ldlework | #nim I'm trying to impress some people |
22:32:34 | ldlework | Someone snap out a little template/macro that memoizes an arbitrary block of code |
22:32:41 | ldlework | I 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:10 | Serenitor | hm, there's nothing in nim that translates pretty much 1:1 to union, is there? |
22:43:30 | FromGitter | <ivankoster> there is a union pragma to turn object into a C union |
22:44:01 | FromGitter | <ivankoster> manual says that it cannot be used with garbage collected values inside then union though |
22:44:13 | dom96 | ldlework: could this be what you want? https://github.com/andreaferretti/memo |
22:44:49 | ldlework | dom96: for arbitrary blocks! |
22:44:50 | ldlework | :( |
22:45:07 | ldlework | like a python with: statement that only runs the code once and then memoizes what variables changed |
22:45:13 | ldlework | and just always sets them to those values |
22:45:46 | dom96 | sounds like a fun nim metaprogramming exercise for you to try :P |
22:46:38 | ldlework | haha I doubt I have a working nim |
22:46:55 | * | nsf quit (Quit: WeeChat 1.7) |
22:48:38 | dom96 | Why wouldn't you? |
22:57:26 | ldlework | Because I'm a liar |
22:57:33 | ldlework | I'm writing my own docker based package manager |
22:57:39 | ldlework | obviously I have dockerized nim |
22:57:44 | * | couven92 joined #nim |
22:57:55 | ldlework | thanks to whoever is maintaining that |
22:58:01 | ldlework | dom96: did you see my video? |
22:58:24 | ldlework | dom96: 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:29 | ldlework | using mono |
22:58:38 | ldlework | I actually laughed out loud |
22:58:44 | ldlework | its just a cruel irony you know |
22:58:56 | ldlework | dom96: https://s3-us-west-2.amazonaws.com/converterpoint-2/encodings/579b289bae8bd123c25ad8bef0c0623b.webm |
23:01:02 | Serenitor | @ivankoster thx I think I found a solution for my case |
23:03:58 | * | couven92 quit (Ping timeout: 240 seconds) |
23:08:03 | dom96 | ldlework: All I can do is encourage you to be more comfortable diving into Nim's standard library |
23:08:50 | dom96 | Why does Docker use HTTP btw? |
23:09:06 | ldlework | dom96: because it offers a remote API |
23:09:12 | ldlework | you can controller docker hosts from afar |
23:09:18 | ldlework | http is pretty standard. |
23:09:41 | dom96 | I see. |
23:15:03 | FromGitter | <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:36 | dom96 | bah, glot.io really needs to make their code window bigger |
23:19:50 | dom96 | ivankoster: https://gist.github.com/dom96/bd41d8464b9880d4506f89ecc187f119 |
23:20:07 | dom96 | You can do something like this, not sure if that helps |
23:22:18 | ldlework | maybe 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:25 | ldlework | :) |
23:24:36 | dom96 | 'night |
23:39:10 | zachcarter | debugging nim + android is difficult |
23:39:19 | zachcarter | hell the ndk is difficult |
23:39:29 | zachcarter | I 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:45 | FromGitter | <Varriount> zachcarter: I applaud you for even trying. NDK documentation is really sparse. |
23:43:03 | zachcarter | to say the least |
23:43:24 | zachcarter | I’ve at least got an apk compiling, it’s just crashing to the homescreen |
23:43:35 | zachcarter | and it doesn’t help the AVD I’m running is spamming logcat with nonsense errors |
23:46:20 | demi- | NDK is awful, a lot of the android tooling is fucking awful |
23:46:24 | zachcarter | agreed |
23:46:58 | zachcarter | it doesn’t help there isn’t a good C/C++ IDE |
23:47:04 | zachcarter | CLion is the closest thing we have I think |
23:47:21 | zachcarter | but it’s still a pain in the ass as it doesn’t integrate fully with android |
23:47:27 | FromGitter | <Varriount> @Serenitor Nim has a {.union.} to turn a type into a C-like union, however it has limitations. |
23:47:43 | FromGitter | <Varriount> *{.union.} pragma |
23:48:00 | zachcarter | like 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:13 | zachcarter | so frustrating |
23:48:21 | zachcarter | and the notion that jetbrains is going to produce kotlin native lol... |
23:48:36 | zachcarter | can’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:52 | FromGitter | <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. |