00:10:41 | * | user0 joined #nim |
00:12:11 | Araq | 'of RootObj' enables inheritance |
00:12:20 | * | PMunch quit (Quit: leaving) |
00:13:59 | * | PMunch joined #nim |
00:14:28 | PMunch | Yeah, but how? |
00:14:51 | PMunch | Is it just syntactic or is there a different structure to them |
00:24:44 | PMunch | Araq? |
00:25:11 | Araq | it has a typeinfo field at offset 0 then |
00:25:31 | Araq | so that type conversions can be checked at runtime |
00:25:34 | Araq | good night. |
00:26:56 | * | Trioxin joined #nim |
00:28:08 | Trioxin | I was thinking about it last night as I try to go to sleep. Nim is the all around best programming language of all time. |
00:28:50 | Trioxin | one of us. one of us. gooble gobble gooble gobble |
00:32:16 | * | user0 quit (Quit: user0) |
00:32:25 | PMunch | Aah, thanks for the answer |
00:32:37 | PMunch | Going to bed as well now |
00:32:37 | * | user0 joined #nim |
00:32:52 | * | user0 quit (Client Quit) |
00:35:51 | * | PMunch quit (Quit: Bye) |
00:36:05 | * | jsgrant_om quit (Ping timeout: 240 seconds) |
00:39:35 | * | rauss joined #nim |
00:47:20 | * | chemist69 quit (Ping timeout: 258 seconds) |
00:47:24 | * | Serenitor quit (Read error: Connection reset by peer) |
00:48:03 | * | Serenitor joined #nim |
00:50:40 | * | chemist69 joined #nim |
00:50:44 | zachcarter | Anyone have any tips on how I can bind to : |
00:51:15 | zachcarter | https://github.com/bkaradzic/bgfx/blob/master/examples/common/nanovg/nanovg.h#L37-L45 |
00:52:32 | * | user0 joined #nim |
00:53:14 | * | Jesin quit (Ping timeout: 245 seconds) |
00:58:49 | * | Jesin joined #nim |
01:00:19 | enthus1ast | if i remember right c structs are nim object but no gurantee on that |
01:03:40 | * | user0 quit (Quit: user0) |
01:03:42 | enthus1ast | c2 nim creates this https://gist.github.com/anonymous/4dae0635f8dd3d0f37c25b35d9b9efdf |
01:03:47 | enthus1ast | ^ zachcarter |
01:04:00 | zachcarter | yeah :/ |
01:04:07 | enthus1ast | maybe i understand you wrong i can barely hold my eyes open ; ) |
01:04:27 | zachcarter | it’s just that doesn’t seem to be working fo rme |
01:04:28 | zachcarter | for me |
01:04:30 | zachcarter | what c2nim produces |
01:05:11 | enthus1ast | what does it say? |
01:05:49 | zachcarter | well I mean everything compiles |
01:06:08 | zachcarter | it’s just where the object is used in other function calls, memory doesn’t seem to be laying out as I expect |
01:07:01 | zachcarter | values aren’t assigned to the fields correctly |
01:07:06 | * | jsgrant_om joined #nim |
01:08:15 | * | arnetheduck joined #nim |
01:10:35 | enthus1ast | sorry i'll be no help |
01:14:39 | zachcarter | np |
01:14:49 | zachcarter | thanks for trying |
01:21:04 | FromGitter | <Varriount> zachcarter: Have you tried using the `pure` pragma on data types? |
01:21:16 | zachcarter | I haven’t |
01:21:41 | zachcarter | on enums yes |
01:57:31 | * | dddddd quit (Remote host closed the connection) |
01:58:39 | * | chemist69 quit (Ping timeout: 245 seconds) |
02:11:35 | Trioxin | how can I return mysql query results to something associative? |
02:11:46 | Trioxin | I'm using getRow at the moment |
02:12:08 | Trioxin | jobQ = db.getRow(sql"SELECT * FROM `jobs` WHERE `progress` = 0 LIMIT 1") |
02:12:21 | Trioxin | then I have to do like echo jobQ[0] |
02:12:36 | * | chemist69 joined #nim |
02:16:58 | ftsf | dom69 after installing switching to devel it works \o/ and nimble tasks work too |
02:25:20 | Trioxin | is it possible to get apache to serve up nim applications? |
02:25:44 | Trioxin | I know I could serve up my own http requests but I don't really want to |
02:29:21 | * | zachcarter quit (Quit: zachcarter) |
02:38:25 | ftsf | Trioxin, apache can serve up whatever app via cgi |
02:41:14 | * | ftsf_ joined #nim |
02:47:42 | * | enthus1ast quit (Ping timeout: 258 seconds) |
02:47:54 | * | enthus1ast joined #nim |
02:53:56 | Trioxin | never had to do that before. I do see the nim cgi module |
02:56:47 | * | brson quit (Quit: leaving) |
03:08:39 | Trioxin | got it goin with cgi module and apache's cgi-bin. sick of crappy PHP for my APIs |
03:08:56 | Trioxin | :) |
03:09:47 | FromGitter | <ftsf> cool |
03:09:51 | FromGitter | <ftsf> yeah php =( |
03:10:54 | Trioxin | PHP has been great for so many things for me and I always justified it with "It's rapid dev" but nim is far more rapid and can't beat performance |
03:10:58 | Serenitor | zachcarter was trying something like that the other day as well but gave up on recreating it exactly since apparently nim can't have something like anonymous unions/structs (where the contants "drop down" into the parent struct) |
03:13:03 | FromGitter | <ftsf> I switched from PHP to python for web stuff a long time ago and never looked back, but these days i'd give nim a try for it |
03:13:18 | FromGitter | <ftsf> lack of static typing in python was really annoying |
03:15:30 | Trioxin | I never got into python until recent years for machine learning. I'm just ready to go all in with Nim though. Obciously using a pre-processor has its benefits but I don't REALLY need it. |
03:18:57 | * | ftsf_ quit (Ping timeout: 240 seconds) |
03:23:37 | FromGitter | <Varriount> Nim needs better DB support though |
03:24:09 | * | Serenitor quit (Quit: Leaving) |
03:31:10 | Trioxin | I'm using Nim's MySQL right now. First thing I'm missing right off the bat are associative arrays as results |
03:31:27 | Trioxin | but that's okay |
03:32:57 | ftsf | I suspect it wouldn't be too hard to add |
03:33:06 | ftsf | if you know the column names and the order |
03:36:39 | Trioxin | hmm. also, it seems that all results are returned as strings |
03:39:06 | ftsf | hmm that doesn't surprise me |
03:39:50 | Trioxin | crap |
03:40:09 | Trioxin | cast? |
03:40:10 | ftsf | that's how the mysql c api works |
03:40:28 | ftsf | no you need to parse not cast |
03:40:47 | ftsf | parseInt parseFloat etc |
03:40:58 | Trioxin | ah thx |
03:41:05 | ftsf | from strutils |
03:42:17 | * | def-pri-pub quit (Quit: leaving) |
03:42:33 | Trioxin | parseutils |
03:42:58 | ftsf | hmm weird, wonder why those functions are in both modules |
03:43:57 | Trioxin | oh wait, you're right |
03:44:14 | Trioxin | I was looking at the h2 of the doc page |
03:45:40 | ftsf | gotta go, good luck |
04:03:38 | * | niomix joined #nim |
04:05:18 | niomix | hey guys, i get this error while i am trying to install nimble: ... Error: execution of an external program failed: 'gcc -c -w -O3 -fno-strict-aliasing -I/usr/lib/nim -o /home/yogurt/nimble/src/nimcache/compiler_algorithm.o /home/yogurt/nimble/src/nimcache/compiler_algorithm.c' |
04:05:41 | niomix | but then i copy and paste the command and it works |
04:06:02 | niomix | then i can continue but then i get the same error so i have to copy and paste all the time |
04:08:01 | niomix | i don't mind tbh, im just letting you know this issue |
04:10:28 | * | Trioxin quit (Remote host closed the connection) |
04:11:12 | * | Trioxin joined #nim |
04:26:31 | Trioxin | when I use roun() I wind up with a number like 1494649465.0. In C you use (int) but I don't see how to do it here. |
04:27:15 | Trioxin | think I have to use cast in this case |
04:35:57 | * | Trioxin quit (Ping timeout: 240 seconds) |
04:39:23 | * | Trioxin joined #nim |
04:39:54 | FromGitter | <Varriount> Triokin: What are you trying to do? |
04:40:01 | FromGitter | <Varriount> *Trioxin |
04:40:57 | FromGitter | <Varriount> Trioxin: https://nim-lang.org/docs/manual.html#statements-and-expressions-type-conversions |
04:41:31 | * | Trioxin2 joined #nim |
04:43:54 | * | asdasdwqeq joined #nim |
04:43:57 | * | Trioxin quit (Ping timeout: 240 seconds) |
04:47:12 | * | Trioxin2 quit (Ping timeout: 272 seconds) |
04:48:55 | asdasdwqeq | oh, it's int |
04:49:02 | * | asdasdwqeq is now known as Trioxin |
04:52:26 | FromGitter | <Varriount> niomix: Hm, any other information on why GCC is failing? |
04:53:02 | niomix | idk, what info do you need?, im completly noob |
04:54:01 | niomix | Building nimble/nimble using c backend, this is taking too much time |
04:54:21 | FromGitter | <Varriount> Well, full output would be nice. |
04:54:27 | niomix | ok |
04:54:35 | FromGitter | <Varriount> Generally GCC will print out why it fails |
04:55:00 | niomix | but when i run the command in the terminal it works |
04:56:28 | FromGitter | <Varriount> niomix: Which could be due to a number of things - permissions, environment variables, paths, etc |
04:57:28 | niomix | oh |
04:58:09 | FromGitter | <Varriount> So try running nimble with the '--verbose' flag, post the output here, and we'll see if there's anything to glean from the output. |
04:58:23 | * | bjz joined #nim |
04:58:24 | niomix | ok thanks, i will do that |
04:58:53 | FromGitter | <Varriount> Uh, please use a paste service though. |
05:00:12 | niomix | ok |
05:02:34 | niomix | well i gtg, i carry on later, thanks for the help |
05:02:43 | * | niomix quit (Remote host closed the connection) |
05:31:10 | * | rauss quit (Quit: WeeChat 1.7.1) |
05:58:16 | * | Trioxin2 joined #nim |
06:01:14 | * | Trioxin quit (Ping timeout: 240 seconds) |
06:49:08 | Trioxin2 | I'm trying to pass an argument to exec() for my MySQL query. The argument was returned as a result of a previous query: var jobIdStr:string = job[0] but then passing that to exec I get: [jobIdStr])' has no type (or is ambiguous) |
06:51:04 | ftsf | Trioxin2, what's the code you're using? |
06:51:25 | Trioxin2 | db.exec(sql"UPDATE `jobs` SET `progress` = `progress` + 1 WHERE `ID` = ?", jobIdStr) |
06:52:20 | Trioxin2 | well, actually I should have passed an int there but same result |
06:53:10 | Trioxin2 | db.fastRows(sql"SELECT * FROM `jobs` WHERE `progress` < `clicks`") then var jobId = job[0].parseInt then var jobHold = db.exec(sql"UPDATE `jobs` SET `progress` = `progress` + 1 WHERE `ID` = ?", jobId) |
06:53:45 | ftsf | db.exec expects strings as the last varargs |
06:55:07 | ftsf | although it coerces everything to string for you |
06:55:24 | ftsf | what's the code where you get the error? |
06:55:34 | Trioxin2 | db.exec(sql"UPDATE `jobs` SET `progress` = `progress` + 1 WHERE `ID` = ?", jobId) |
06:55:43 | ftsf | and the error is? |
06:56:09 | Trioxin2 | SqlQuery(r"UPDATE `jobs` SET `progress` = `progress` + 1 WHERE `ID` = ?"), |
06:56:11 | Trioxin2 | [jobId])' has no type (or is ambiguous) |
06:56:34 | ftsf | what is jobId? |
06:57:03 | Trioxin2 | the return of another mysql query assigned as: var jobId = job[0].parseInt |
06:57:17 | Trioxin2 | but same result even if I don't use parseint |
06:57:48 | Trioxin2 | it's returned from db.fastRows(sql"SELECT * FROM `jobs` WHERE `progress` < `clicks`") |
06:58:42 | * | Trioxin2 is now known as Trioxin |
06:59:07 | ftsf | works for me when i defined var jobId = 0 |
06:59:21 | Trioxin | for job in db.fastRows(sql"SELECT * FROM `jobs` WHERE `progress` < `clicks`"): |
06:59:23 | Trioxin | var jobId = job[0].parseInt |
06:59:37 | ftsf | https://gist.github.com/ftsf/ac567edb744397c5bbe8bae912ad8f3d compiles fine |
06:59:45 | Trioxin | try fastRows |
06:59:53 | ftsf | gist your whole code |
07:01:01 | ftsf | https://gist.github.com/ftsf/955728c9ea122357f1ef725c0d5eee8f compiles fine too |
07:02:53 | Trioxin | https://gist.github.com/anonymous/96371d1b2a020a69461bb788af4f20df |
07:03:35 | Trioxin | https://gist.github.com/anonymous/f34c2dcb691f059638fbd1cf5ab699e5 |
07:03:49 | Trioxin | meh. one sec... |
07:05:27 | ftsf | ok you're trying to return a value from db.exec |
07:05:33 | ftsf | which doesn't return a value |
07:05:45 | ftsf | remove the "var jobHold = " |
07:13:13 | Trioxin | yeah, just figured that out and it compiles but when I run it I get: Error: unhandled exception: Commands out of sync; you can't run this command now [DbError] |
07:13:45 | ftsf | querying before you've read all the data? |
07:14:00 | Trioxin | oh |
07:14:02 | Trioxin | damn |
07:26:17 | Trioxin | "Breaking the fastRows() iterator during a loop will cause the next database query to raise an [EDb] exception " what constitues a break? |
07:26:43 | ftsf | calling break ? |
07:27:15 | Trioxin | well, I didn't call a break and it still raised it. I just tried to run another query within the iteration |
07:28:27 | ftsf | yeah, i suspect you can only run one query at a time until you've flushed all the results |
07:28:36 | * | gokr joined #nim |
07:28:51 | ftsf | https://dev.mysql.com/doc/refman/5.7/en/commands-out-of-sync.html |
07:56:04 | * | zachcarter joined #nim |
08:03:38 | * | Trustable joined #nim |
08:25:34 | * | Matthias247 joined #nim |
08:28:51 | * | ftsf_ joined #nim |
08:36:17 | * | Trustable quit (Remote host closed the connection) |
08:57:18 | * | Trustable joined #nim |
08:59:48 | * | zachcarter quit (Quit: zachcarter) |
09:09:38 | * | BennyElg quit (Remote host closed the connection) |
09:14:29 | Trioxin | do any of these return without waiting for the process to finish? https://nim-lang.org/docs/osproc.html |
09:15:40 | Trioxin | guess I could just use & |
09:16:44 | Trioxin | > /dev/null 2>&1 & |
09:17:10 | Trioxin | execProcesses() is super helpful |
09:17:51 | Araq | runProcess vs execProcess is the naming convention irrc |
09:18:00 | Araq | please patch the docs to make it clear |
09:18:22 | Araq | don't use & or other shell crap, not portable and a security problem |
09:19:43 | * | ftsf_ quit (Quit: Leaving) |
09:20:08 | * | yglukhov joined #nim |
09:22:29 | Trioxin | execProcesses: executes the commands cmds in parallel. |
09:32:07 | * | chemist69 quit (Ping timeout: 246 seconds) |
09:37:11 | * | BennyElg joined #nim |
09:37:29 | * | chemist69 joined #nim |
09:39:04 | * | yglukhov quit (Remote host closed the connection) |
09:40:44 | * | yglukhov joined #nim |
09:40:55 | Araq | I said 'execProcess' |
09:41:01 | Araq | singular |
09:45:09 | * | bjz quit (Quit: Textual IRC Client: www.textualapp.com) |
09:53:40 | ftsf | Trioxin, sounds like you want to fork and exec the process perhaps? |
09:54:02 | ftsf | not sure if nim has something along those lines other than via the posix module |
09:55:58 | Trioxin | ftsf. I think startProcess returns before the command is done. I ran nano and it didn't block |
09:56:53 | ftsf | ok cool |
09:56:57 | Trioxin | discard startProcess("nano","/usr/bin") |
09:57:22 | Trioxin | it should say that in the doc though |
10:01:34 | * | adeohluwa joined #nim |
10:01:48 | Trioxin | editing docs in this manner is cumbersome |
10:03:54 | * | bjz joined #nim |
10:07:33 | Araq | you mean with the 'edit' button right on the page? |
10:07:50 | Trioxin | the ## in the markdown |
10:08:07 | Araq | it's not markdown, it's RST. |
10:08:17 | Trioxin | oh. still |
10:08:24 | * | Tiberium joined #nim |
10:08:27 | Araq | you can also use ##[multi line comment here]## |
10:08:52 | Trioxin | that wasn't done for some reason |
10:08:57 | Trioxin | edit! |
10:09:30 | Trioxin | my favoriate language docs are actually PHP's |
10:14:55 | Araq | my favorite are Nim's |
10:15:48 | Trioxin | well, would be nice for every proc to have a good description and example(s). comments wouldn't hurt either |
10:16:21 | Araq | everybody complains about them but I like them. they document types, raised exceptions and don't contain chapters that describe the type signatures again in prose. |
10:16:27 | FromGitter | <Varriount> Python's and MDN's JavaScript docs are my favorite. |
10:16:58 | Araq | more examples are missing though. |
10:18:09 | Trioxin | there are some things about nim docs I don't even get yet |
10:18:34 | Trioxin | something like this seems more of a nightmare than a help: |
10:18:37 | Trioxin | proc execProcesses(cmds: openArray[string]; |
10:18:39 | Trioxin | options = {poStdErrToStdOut, poParentStreams}; |
10:18:40 | Trioxin | n = countProcessors(); beforeRunEvent: proc (idx: int) = nil; |
10:18:42 | Trioxin | afterRunEvent: proc (idx: int; p: Process) = nil): int {..} |
10:19:08 | * | yglukhov quit (Remote host closed the connection) |
10:19:36 | Araq | see? that's a good example. I can understand everything in that piece immediately. :P |
10:19:59 | Trioxin | yeah idk what's going on there until I start messing with code |
10:20:15 | Araq | cmds # well it runs these |
10:20:23 | Trioxin | yea |
10:20:32 | Trioxin | next is params |
10:20:38 | Trioxin | next is how many to spawn |
10:20:41 | Araq | options = {poStdErrToStd # obvious stderr -> stdout redirection is default |
10:20:46 | Trioxin | after that is an enigma |
10:21:06 | Araq | poParenStreams -> processes inherit stdin/stdout/etc file handles |
10:21:26 | Araq | n # used number of CPUs, autodetection is the default |
10:21:52 | Araq | beforeRunEvent # callback before cmds[idx] is executed |
10:22:10 | Araq | afterRunEvent # callback after cmds[idx] was executed |
10:22:26 | Araq | default to 'nil', so usually nothing is done |
10:22:42 | Trioxin | ah |
10:23:16 | Trioxin | beforeRunEvent: proc (idx: int) .... idx: int? |
10:23:37 | FromGitter | <Varriount> The index of the process being run |
10:23:40 | Trioxin | oh.. what is passed to callback |
10:23:43 | Trioxin | oh |
10:23:57 | FromGitter | <Varriount> I mean, command |
10:27:06 | * | Snircle joined #nim |
10:30:02 | Trioxin | running nano would have blocked my program if startProcess() waited for finish right? |
10:30:25 | Araq | yeah I think so |
10:30:29 | Trioxin | nvm I'll just make an infinite loop to test |
10:31:31 | * | Matthias247 quit (Read error: Connection reset by peer) |
10:36:45 | Trioxin | yeah it doesn't block |
10:46:08 | * | xet7 joined #nim |
10:53:54 | Trioxin | ls |
10:53:58 | Trioxin | oops |
10:54:16 | * | zachcarter joined #nim |
11:01:19 | * | zachcarter quit (Read error: Connection reset by peer) |
11:01:40 | * | zachcarter joined #nim |
11:04:02 | Trioxin | how do I set ProcessOption? https://nim-lang.org/docs/osproc.html#startProcess |
11:04:30 | Tiberium | Trioxin, https://nim-lang.org/docs/osproc.html#ProcessOption |
11:04:31 | Trioxin | options: set[ProcessOption] = {poStdErrToStdOut} |
11:04:45 | Tiberium | Trioxin, like {poEvalCommand, poDemon} but you'll have different ones |
11:04:54 | Tiberium | options={poEvalCommand, poDemon} |
11:05:32 | Trioxin | oh enums |
11:12:00 | Araq | see? the docs are awesome, it's just that you need more knowledge of Nim in general, the API docs don't teach the language ;-) |
11:16:39 | Trioxin | yeah sometimes that's the case. I've only casually used Nim but now I'm really getting into production. Best way to master |
11:19:29 | Trioxin | I'm having a problem now. What should be my last problem for a while. I'm trying to do `npm start` so I do this: https://hastebin.com/axogohahiq.go but in a separate session I do `ps x` and I see a bunch of these: pts/0 Z+ 0:00 [npm] <defunct>. Also, startProcess doesn't block or return anything (Good) but if I kill my program, all the npm die (They're children like that?). I'm 99% sure they're not starting up properly though. |
11:36:48 | zachcarter | Could use some help with this one |
11:36:52 | zachcarter | https://gist.github.com/zacharycarter/2798a346211782c943b0eb6cfee929a5 |
11:37:03 | zachcarter | top output is from Nim, bottom output is from C |
11:37:10 | zachcarter | here are the bindings and the data structures |
11:37:38 | Araq | Trioxin: I think that's just Unix's process model. children die with their parents |
11:39:14 | Araq | zachcarter: what about it? |
11:39:53 | zachcarter | https://gist.github.com/zacharycarter/bbeaa36f402a5c98b760bf7ed2e7f0d8 |
11:40:27 | zachcarter | Araq: I’d expect the values in the C invocation to match what they were prior to being passed in on the Nim side |
11:40:34 | zachcarter | but they seem to be way off |
11:40:44 | zachcarter | so I’m guessing something in my bindings is screwed up |
11:42:04 | Trioxin | i think it's working now (somehow) |
11:42:20 | zachcarter | maybe because I’m using floats and not cfloats? |
11:42:47 | Araq | zachcarter: sorry c2nim doesn't yet add .bycopy to the object decls |
11:42:53 | Araq | that should fix your problems |
11:43:09 | Araq | also float != cfloat, Nim's float == cdouble |
11:43:12 | zachcarter | Araq: thank you - which objects do I need to add that pragma to |
11:43:26 | Araq | every object that is passed by value to C |
11:43:35 | zachcarter | gotcha thank you |
11:43:40 | Araq | without the 'ptr' |
11:43:50 | zachcarter | much appreciated as always! |
11:46:24 | * | MyMind joined #nim |
11:48:25 | * | Pisuke joined #nim |
11:48:26 | * | Sembei quit (Ping timeout: 255 seconds) |
11:50:44 | * | MyMind quit (Ping timeout: 240 seconds) |
11:58:40 | * | PMunch joined #nim |
11:59:37 | Trioxin | is there any reason to compile with C++ other than interop? |
12:00:44 | Araq | Trioxin: yes, faster exception handling |
12:00:53 | Trioxin | k |
12:03:09 | zachcarter | Araq: brilliant it fixed it |
12:03:42 | zachcarter | bycopy I mean |
12:04:05 | Araq | yeah please create a c2nim issue for that, it's a serious omission |
12:04:55 | zachcarter | will do |
12:04:59 | zachcarter | http://imgur.com/a/dMHRC |
12:05:08 | zachcarter | nanovg support for frag now! |
12:06:47 | zachcarter | https://github.com/nim-lang/c2nim/issues/84 |
12:09:33 | Trioxin | does require() work in Nim for js compile? |
12:10:41 | Trioxin | also await? |
12:11:12 | Trioxin | I need require, await, yeild |
12:11:57 | * | vendethiel joined #nim |
12:14:39 | zachcarter | Trioxin: I think you can wrap JS functions with Nim |
12:16:06 | zachcarter | so worst https://github.com/zacharycarter/nim-playground-frontend/blob/master/src/app.nim#L11-L14 |
12:16:08 | zachcarter | woops |
12:16:15 | zachcarter | I didn’t mean to type so worst |
12:16:27 | zachcarter | I did mean to share that link |
12:17:08 | FromGitter | <stisa> Trioxin: you can probably use jsffi and something like ``proc require(module:string):JsObject {.importcpp: "require(#)".}`` for require, no idea for the others |
12:18:28 | Trioxin | hmm. will not take that leap yet |
12:19:33 | Araq | what does 'require' do? run some bullshit at runtime that should really be done at compiletime? |
12:19:55 | zachcarter | yeah it’s like module injection |
12:19:57 | zachcarter | I believe |
12:20:49 | zachcarter | there’s - http://requirejs.org/ |
12:20:49 | zachcarter | and |
12:20:57 | zachcarter | http://browserify.org/ |
12:21:00 | zachcarter | webpack might use require too |
12:21:02 | zachcarter | I dunno |
12:21:10 | Trioxin | I'm talking about for use with node |
12:21:12 | FromGitter | <stisa> oh I was thinking of https://nodejs.org/api/modules.html |
12:21:33 | zachcarter | oh… I haven’t played with Node and Nim yet |
12:22:10 | Trioxin | was thinking about converting all my node code for this project but time is better spent elsewhere for now |
12:31:19 | * | adeohluwa quit (Quit: Connection closed for inactivity) |
12:33:13 | * | Arrrr joined #nim |
12:33:13 | * | Arrrr quit (Changing host) |
12:33:13 | * | Arrrr joined #nim |
12:49:41 | * | Trioxin quit (Quit: Konversation terminated!) |
12:55:26 | * | Arrrr quit (Read error: Connection reset by peer) |
12:58:28 | * | Arrrr joined #nim |
13:03:29 | Tiberium | https://github.com/nim-lang/Nim/pull/5677 zahary is, indeed, doing very good work. But this PR is already very huge, and it also contains other new features. Will it be merged in a month at least? |
13:17:02 | * | bjz_ joined #nim |
13:17:04 | * | bjz quit (Ping timeout: 260 seconds) |
13:18:33 | Tiberium | also, can I safely say that nim doesn't include runtime in compiled programs? |
13:18:50 | Tiberium | or I misunderstood a "runtime" word? |
13:19:48 | FromGitter | <zacharycarter> you mean runtime as in like virtual machine? |
13:19:59 | FromGitter | <zacharycarter> like the .NET CLR or JVM? |
13:20:52 | Tiberium | and like in Go |
13:20:57 | Tiberium | does it mean Go contains a VM too? |
13:22:21 | FromGitter | <zacharycarter> no golang doesn't run on a VM |
13:22:50 | FromGitter | <zacharycarter> go does have a runtime |
13:23:13 | FromGitter | <zacharycarter> I see what you mean |
13:24:45 | * | PMunch quit (Quit: leaving) |
13:25:10 | FromGitter | <zacharycarter> I don't have a good answer |
13:25:35 | FromGitter | <zacharycarter> @dom96 - is there any way to see the output from the nim compile command when building a binary with nimble? My build is erroring out but I can't tell why |
13:26:27 | dom96 | zacharycarter: upgrade your Nimble. |
13:26:39 | dom96 | zacharycarter: or run with --debug flag |
13:26:46 | FromGitter | <zacharycarter> thanks |
13:37:21 | * | nsf joined #nim |
13:44:08 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
13:49:11 | * | Snircle joined #nim |
13:59:31 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:20:35 | * | jsgrant_om quit (Ping timeout: 240 seconds) |
14:21:25 | * | Tiberium quit (Remote host closed the connection) |
14:22:42 | * | Tiberium joined #nim |
14:30:16 | * | Tiberium quit (Remote host closed the connection) |
14:31:25 | * | Tiberium joined #nim |
14:33:13 | * | Tiberium quit (Remote host closed the connection) |
14:34:31 | * | Tiberium joined #nim |
14:39:43 | * | Ven joined #nim |
14:40:07 | * | Ven is now known as Guest13320 |
14:46:21 | * | nsf quit (Quit: WeeChat 1.7.1) |
14:46:37 | * | Tiberium quit (Remote host closed the connection) |
14:48:05 | * | Tiberium joined #nim |
14:50:13 | * | FromGitter quit (Remote host closed the connection) |
14:50:21 | * | FromGitter joined #nim |
14:51:00 | * | gangstacat quit (Quit: Ĝis!) |
14:54:10 | * | Guest13320 quit (Ping timeout: 240 seconds) |
14:59:06 | * | Ven_ joined #nim |
15:08:35 | * | Ven_ quit (Ping timeout: 240 seconds) |
15:10:36 | * | Ven_ joined #nim |
15:12:15 | * | bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
15:17:30 | * | bjz joined #nim |
15:18:28 | * | krux02 joined #nim |
15:22:13 | * | sz0 quit (Quit: Connection closed for inactivity) |
15:25:21 | * | krux02 quit (Remote host closed the connection) |
15:25:38 | * | krux02 joined #nim |
15:40:38 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:48:29 | FromGitter | <almynic> why does not work correctly nim string are zero terminated right? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59172acc83cb5db07329831d] |
15:58:09 | FromGitter | <almynic> ok figured it on my own ;) the for loop doesn't have a 0 as last index |
16:07:14 | * | Matthias247 joined #nim |
16:24:44 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
16:28:00 | Tiberium | what's the simplest way to filter all duplicated entries in a seq? |
16:34:45 | FromGitter | <yglukhov> @dom96, @Araq, @almynic, another nice sample of null terminator inconsistency |
16:41:34 | * | gangstacat joined #nim |
16:43:22 | * | zachcarter quit (Quit: zachcarter) |
16:46:49 | * | chemist69 quit (Ping timeout: 246 seconds) |
16:47:59 | * | yglukhov joined #nim |
16:50:17 | * | chemist69 joined #nim |
16:50:28 | * | arnetheduck quit (Ping timeout: 272 seconds) |
16:51:13 | * | libman joined #nim |
17:15:05 | * | PMunch joined #nim |
17:23:08 | * | Ven joined #nim |
17:23:31 | * | Ven is now known as Guest10447 |
17:34:49 | * | Guest10447 quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:41:04 | * | nsf joined #nim |
17:42:52 | * | Matthias247 quit (Read error: Connection reset by peer) |
18:04:37 | PMunch | Is there a way to iterate over a slice of some varargs? |
18:05:04 | * | Ven_ joined #nim |
18:10:33 | FromGitter | <konqoro> @PMunch try using '@' proc over varrargs |
18:11:58 | PMunch | Ah, so turning it into a seq |
18:29:38 | * | PMunch quit (Quit: leaving) |
18:57:59 | * | miningold joined #nim |
19:04:40 | * | BennyElg_ joined #nim |
19:05:03 | * | miningold quit (Quit: leaving) |
19:07:33 | * | BennyElg quit (Ping timeout: 260 seconds) |
19:33:19 | euantor | Tiberium: Easiest way is https://nim-lang.org/docs/sequtils.html#deduplicate,seq[T] |
19:41:56 | Tiberium | euantor, lol, I didn't noticed that :D |
19:42:43 | krux02 | what is the easiest way to open a file relative to the executable in nim? |
19:43:15 | Tiberium | krux02, probably https://nim-lang.org/docs/os.html#getAppDir, ? |
19:43:24 | * | Jesin quit (Quit: Leaving) |
19:43:51 | krux02 | looks good, I try it now |
19:47:03 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:55:40 | * | Ven joined #nim |
19:56:04 | * | nsf quit (Quit: WeeChat 1.7.1) |
19:56:04 | * | Ven is now known as Guest93089 |
20:00:11 | * | Arrrr quit (Read error: Connection reset by peer) |
20:02:46 | * | Tiberium quit (Remote host closed the connection) |
20:03:39 | * | Tiberium joined #nim |
20:17:26 | krux02 | getAppDir does work |
20:20:52 | krux02 | a question about nimble and reproducable projects. Lets say I have a dependency that had a bug, I fixed that bug, and did nimble install. Now the projects works only on my machine. How can nimble detect that this case happened? I would like to have a build test that only uses packages in the lowest version that is required and installable via nimble. |
20:21:34 | krux02 | In other words I would like to test the correctness of my dependencies that I specified |
20:54:57 | * | gokr quit (Ping timeout: 240 seconds) |
20:56:31 | FromGitter | <stisa> krux02: if your dependencies have git tags, I think you can specify the version of the dependency in your `.nimble` file. You have to change them and build by hand though, don't know of anything more automated |
20:58:44 | * | Sentreen quit (Ping timeout: 240 seconds) |
21:00:58 | * | Tiberium quit (Remote host closed the connection) |
21:04:06 | FromGitter | <almynic> hi what is the best way to increment a value when using tables? i have words as keys and the wordcount as value. |
21:09:24 | Araq | use a CountTable and its 'inc' operation? |
21:10:07 | FromGitter | <almynic> i use the Table from tables |
21:11:28 | * | Sentreen joined #nim |
21:21:50 | FromGitter | <stisa> @almynic maybe something like ``if t.hasKeyOrPut("hello",1): t["hello"] += 1`` ? |
21:23:32 | * | bjz joined #nim |
21:25:09 | def- | stisa: then you need to search for "hello" twice. What Araq said or t.mgetOrPut("hello", 0) += 1 |
21:25:35 | def- | or just mget if you know it's in |
21:26:17 | FromGitter | <almynic> ok thanks |
21:42:41 | * | zachcarter joined #nim |
21:50:13 | FromGitter | <almynic> this doesn't work why? I get an illegal storage access error like this SIGSEGV: Illegal storage access. (Attempt to read from nil?) ⏎ Error: execution of an external program failed: 'c:\Users\Nicolas\Documents\NimProjects\review.exe ' ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59177f95d1a7716a0ac2bc33] |
21:52:12 | * | nsf joined #nim |
22:03:02 | subsetpark | Hey all, I know there probably isn't a huge market for it, but here's a RPN calculator I wrote in Nim: https://github.com/subsetpark/ad |
22:09:40 | FromGitter | <almynic> ok the solution was to write this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59178424c4d73f445aa3c5fb] |
22:14:11 | * | Trustable quit (Remote host closed the connection) |
22:51:00 | * | libman quit (Quit: Connection closed for inactivity) |
22:51:52 | * | hcorion joined #nim |
22:52:16 | hcorion | Hi all! Is there a quick easy way I can convert a cstring to a fixed length char array? |
22:56:05 | Araq | hcorion: system.copyMem |
22:56:47 | Araq | or use a for loop and let the C backend optimize it to the same. you gain memory safety |
22:56:47 | * | Trioxin joined #nim |
22:57:06 | Trioxin | back to work time |
23:01:28 | * | Trioxin2 joined #nim |
23:04:23 | * | Trioxin quit (Ping timeout: 260 seconds) |
23:04:55 | * | Trioxin2 is now known as Trioxin |
23:12:05 | dom96 | subsetpark: awesome, I wrote an RPN language interpreter when I first started out with Nim :) |
23:13:13 | subsetpark | Yeah, I'm resisting the urge to make it turing complete :) |
23:13:22 | subsetpark | but it's nice to have a quick CLI calculator |
23:35:30 | * | user0 joined #nim |
23:39:17 | Trioxin | I can't wait to get into the macro system. no need yet |
23:46:13 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:46:21 | * | zachcarter quit (Quit: zachcarter) |
23:55:31 | * | user0 quit (Quit: user0) |