00:03:48 | dom96 | filwit: sure, no worries. |
00:05:45 | * | kernasi quit (Quit: Leaving) |
00:06:33 | * | wtw quit (Remote host closed the connection) |
00:25:44 | * | Etheco- joined #nim |
00:28:25 | * | Etheco quit (Ping timeout: 250 seconds) |
00:31:29 | filwit | gah i need to take off but this guy's argument on reddit: "Nim is not safe at all... 'In debug mode, this [Nim] program throws an exception; in release mode, this program [has a null pointer bug]'" |
00:32:51 | filwit | wut? that's the whole point of debug mode.. you just stated it caught the bug during development iteration builds (debug) but then claim that because Nim disables checks for performance in release mode that Nim is unsafe? |
00:34:18 | * | pregressive joined #nim |
00:34:21 | filwit | that sounds a ridiculous stretch for an argument against Nim to me.. if you really want release safety in release builds, Nim also provides that with a simple compiler switch.. |
00:36:24 | fizzbooze | filwit at the cost of performance |
00:37:18 | fizzbooze | there's nothing wrong with his statement of reddit. Nim doesn't aim for memory safety, but that's okay |
00:37:20 | filwit | same goes for Rust, albeit Rust does seem to have more optimized release checks than Nim (something I'm sure we can fix in the future) |
00:37:42 | fizzbooze | filwit: release mode Rust is still memory safe |
00:37:52 | fizzbooze | that's the argument he was going for |
00:37:55 | filwit | yes, and you pay for bouds checks there as well |
00:38:42 | fizzbooze | and that's perfectly okay |
00:39:15 | filwit | either way, it doesn't seem like a valid argument for a large portion of code domains.. games don't need a ton of safety everywhere like large web-apps do, so Nim is more suited for that domain (since you don't pay for them, unlike Rust) |
00:40:35 | fizzbooze | i don't think he was criticizing Nim at all. you seem to take it too personally |
00:41:30 | filwit | No, a) i'm not taking it personally at all.. i just don't find his argument convincing. b) he's trying to use that argument in support of his claim that "Nim is not safe at all" (stated in his original post) |
00:41:55 | fizzbooze | which is true. Nim is not memory safe |
00:42:05 | fizzbooze | it compiles to C after all |
00:42:13 | fizzbooze | so it inherits all the pitfalls of C |
00:42:23 | fizzbooze | but that's not to say that Nim isn't better than C |
00:42:38 | filwit | no it does not, it does checks way before the c-codegen happens |
00:42:52 | filwit | you have enable bounds checks in release mode if you want |
00:43:17 | fizzbooze | bound check is far from the only pitfall it inherits |
00:43:30 | filwit | sure |
00:43:30 | * | saml_ joined #nim |
00:43:43 | filwit | but that's not the point I'm talking about |
00:44:10 | filwit | saying that because Nim compiles to C it's unsafe is like saying Rust is unsafe because it compiles (indirectly) to ASM which is unsafe (if written by hand) |
00:44:15 | * | qwr . o O ( imho it has nothing to do with compilation target being C... ) |
00:44:55 | fizzbooze | i don't think that was what he said |
00:45:17 | fizzbooze | he said it's unsafe because it doesn't attempt to enforce memory safety on release builds |
00:45:26 | fizzbooze | like this https://news.ycombinator.com/item?id=9050999 |
00:45:52 | filwit | that's not "unsafe" tho.. and you *can* enforce those safety checks in release mode.. it's just not default |
00:46:15 | fizzbooze | you can, at the cost of runtime overhead |
00:46:34 | filwit | full circle: same goes for Rust (runtime overhead for checks) |
00:46:39 | fizzbooze | rather than eliminating them completely at compile time like RUst. i think that was his argument |
00:46:45 | fizzbooze | which is correct |
00:46:55 | filwit | rust does not eliminate them entirely for release builds |
00:46:59 | qwr | it's performance/safety tradeoff which you can choose, and (arguably) insufficient static checks (which probably are another tradeoff in complexity) |
00:47:09 | filwit | although it seems to have more intelligent elimination of them |
00:47:55 | filwit | don't get me wrong, Rust is very well designed in many ways (im not a fan of it's syntax, but that's not an argument against it) |
00:48:19 | filwit | i'm not trying to say anything negative about Rust here.. only saying that this guy's argument's against Nim don't add up |
00:49:01 | fizzbooze | that Nim isn't memory safe? i think he did a good job of demonstrating that |
00:49:42 | fizzbooze | saying that it's memory safe because you can enable runtime checks is not very meaningful. because that would be C and C++ are totally memory safe |
00:49:54 | filwit | i can't speak to his first points (on HN), but the last one he clearly does not demonstrate that.. |
00:50:47 | filwit | and I'm only talking about his third point here, not potential other memory safety issues with Nim.. obviously some things are unsafe in Nim (like shared memory... unless you use bohemian GC) |
00:50:49 | fizzbooze | the one where he produced undefined behaviour? |
00:51:04 | filwit | the one he gives a code example of |
00:51:29 | filwit | I don't know enough about his first two points, and he may very well have valid arguments there |
00:51:38 | fizzbooze | he gave an example of a nim program that derefs nil pointers at runtime |
00:51:51 | fizzbooze | looks like a valid argument to me |
00:52:28 | filwit | it's not tho |
00:52:35 | filwit | cause debug build catches it |
00:52:43 | filwit | and release mode can catch it too, if you want |
00:53:04 | filwit | and you never release code without testing a debug build first |
00:53:29 | fizzbooze | that sounds like an argument for javascript. "it's fine, just make sure you test before you release" |
00:53:52 | filwit | that's not an argument |
00:54:43 | qwr | imho the current release build default is bad, though, given the security problems we're constantly having with software |
00:54:59 | filwit | qwr: depends on your domain |
00:55:14 | filwit | again, games don't need this level of security in release builds by default |
00:55:51 | filwit | but then, i kinda agree in a way.. your should cater to those who don't know what they're doing more, and let those that do opt-out |
00:55:56 | filwit | you* |
00:55:57 | qwr | yes, but imho it should be more explicit "to hell with safety" flag that game developers can enable :) |
00:56:30 | filwit | yes, i agree tbh |
00:57:00 | filwit | cause the number of domains which *do* want release saftey probably outnumber those that don't |
00:57:17 | fizzbooze | how would the thread local GC affect games? you have to deep clone an object if you want to send it to another thread |
00:57:50 | * | brson quit (Quit: Lost terminal) |
00:57:51 | filwit | often games manage their own memory pools for performance anyways |
00:58:06 | * | brson joined #nim |
00:58:20 | filwit | only scripts rely on the GC, and they easily fit into the threadpool.parallel/spawn blocks |
00:58:28 | * | tmku quit (Ping timeout: 252 seconds) |
00:59:21 | filwit | but that's another discussion entirely |
00:59:36 | * | tmku joined #nim |
01:00:11 | fizzbooze | does nim have a built in object pool library? |
01:00:11 | * | fizzbooze quit (Quit: WeeChat 1.1.1) |
01:00:28 | * | fizzbooze joined #nim |
01:00:33 | filwit | not that i'm aware of |
01:00:55 | filwit | Jehan had some interesting suggested about shared memory GC on the forums a little while ago as well |
01:01:09 | filwit | it would be a good addition to the standard libs though |
01:01:50 | filwit | anyways, i need to go (i like this conversation, and I hope I didn't come off as rude, it was not my intention) |
01:01:50 | fizzbooze | sounds like no small task |
01:02:02 | fizzbooze | no worries |
01:02:10 | filwit | bye |
01:02:12 | * | filwit quit (Quit: Leaving) |
01:06:16 | * | heinrich5991 quit (Ping timeout: 256 seconds) |
01:07:35 | * | heinrich5991 joined #nim |
01:14:15 | * | infinity0_ joined #nim |
01:14:15 | * | infinity0_ quit (Changing host) |
01:14:15 | * | infinity0_ joined #nim |
01:14:15 | * | infinity0 is now known as Guest34739 |
01:14:15 | * | Guest34739 quit (Killed (asimov.freenode.net (Nickname regained by services))) |
01:14:15 | * | infinity0_ is now known as infinity0 |
01:16:53 | * | polde quit (*.net *.split) |
01:16:54 | * | JStoker quit (*.net *.split) |
01:16:54 | * | iivvoo quit (*.net *.split) |
01:16:55 | * | Guest67437 quit (*.net *.split) |
01:16:55 | * | reloc0 quit (*.net *.split) |
01:16:55 | * | dom96 quit (*.net *.split) |
01:16:57 | * | Gonzih quit (Ping timeout: 264 seconds) |
01:20:17 | * | polde joined #nim |
01:20:17 | * | JStoker joined #nim |
01:20:17 | * | iivvoo joined #nim |
01:20:17 | * | Guest67437 joined #nim |
01:20:17 | * | reloc0 joined #nim |
01:20:17 | * | dom96 joined #nim |
01:20:40 | * | JStoker quit (Max SendQ exceeded) |
01:21:23 | * | polde quit (Quit: q) |
01:24:50 | * | polde joined #nim |
01:24:56 | * | JStoker joined #nim |
01:24:57 | * | JStoker quit (Changing host) |
01:24:57 | * | JStoker joined #nim |
01:24:57 | * | JStoker is now known as 32NABEVRL |
01:35:25 | * | Trustable quit (*.net *.split) |
01:35:25 | * | shalabh quit (*.net *.split) |
01:35:25 | * | clone1018 quit (*.net *.split) |
01:35:25 | * | ekarlso quit (*.net *.split) |
01:35:26 | * | delian66 quit (*.net *.split) |
01:35:26 | * | brson quit (*.net *.split) |
01:35:27 | * | ChrisMAN quit (*.net *.split) |
01:35:27 | * | aidanh quit (*.net *.split) |
01:35:27 | * | jsudlow quit (*.net *.split) |
01:35:27 | * | dhasenan_ quit (*.net *.split) |
01:35:27 | * | vince- quit (*.net *.split) |
01:35:28 | * | jj2baile quit (*.net *.split) |
01:35:28 | * | xandy quit (*.net *.split) |
01:35:28 | * | chewbranca quit (*.net *.split) |
01:35:28 | * | buMPnet_ quit (*.net *.split) |
01:35:28 | * | def- quit (*.net *.split) |
01:35:29 | * | Zuchto quit (*.net *.split) |
01:35:29 | * | rektide_ quit (*.net *.split) |
01:35:29 | * | Amrykid quit (*.net *.split) |
01:35:29 | * | ldlework quit (*.net *.split) |
01:37:12 | * | aidanh joined #nim |
01:38:12 | * | n0x0ff joined #nim |
01:39:25 | * | brson joined #nim |
01:39:26 | * | Trustable joined #nim |
01:39:26 | * | shalabh joined #nim |
01:39:26 | * | ChrisMAN joined #nim |
01:39:26 | * | clone1018 joined #nim |
01:39:26 | * | ekarlso joined #nim |
01:39:26 | * | jsudlow joined #nim |
01:39:26 | * | delian66 joined #nim |
01:39:26 | * | dhasenan_ joined #nim |
01:39:26 | * | vince- joined #nim |
01:39:26 | * | jj2baile joined #nim |
01:39:26 | * | chewbranca joined #nim |
01:39:26 | * | xandy joined #nim |
01:39:26 | * | buMPnet_ joined #nim |
01:39:26 | * | def- joined #nim |
01:39:26 | * | Zuchto joined #nim |
01:39:26 | * | rektide_ joined #nim |
01:39:26 | * | Amrykid joined #nim |
01:39:26 | * | ldlework joined #nim |
01:40:16 | * | Trustable quit (*.net *.split) |
01:40:16 | * | shalabh quit (*.net *.split) |
01:40:16 | * | clone1018 quit (*.net *.split) |
01:40:16 | * | ekarlso quit (*.net *.split) |
01:40:17 | * | delian66 quit (*.net *.split) |
01:40:17 | * | brson quit (*.net *.split) |
01:40:18 | * | ChrisMAN quit (*.net *.split) |
01:40:18 | * | jsudlow quit (*.net *.split) |
01:40:18 | * | dhasenan_ quit (*.net *.split) |
01:40:18 | * | vince- quit (*.net *.split) |
01:40:19 | * | jj2baile quit (*.net *.split) |
01:40:19 | * | xandy quit (*.net *.split) |
01:40:19 | * | chewbranca quit (*.net *.split) |
01:40:20 | * | buMPnet_ quit (*.net *.split) |
01:40:20 | * | def- quit (*.net *.split) |
01:40:20 | * | Zuchto quit (*.net *.split) |
01:40:20 | * | rektide_ quit (*.net *.split) |
01:40:20 | * | Amrykid quit (*.net *.split) |
01:40:20 | * | ldlework quit (*.net *.split) |
01:40:44 | * | 32NABEVRL quit (*.net *.split) |
01:40:44 | * | clone1018_ quit (*.net *.split) |
01:40:44 | * | MyMind quit (*.net *.split) |
01:40:45 | * | Sornaensis quit (*.net *.split) |
01:41:48 | * | brson joined #nim |
01:41:48 | * | Trustable joined #nim |
01:41:48 | * | shalabh joined #nim |
01:41:48 | * | ChrisMAN joined #nim |
01:41:48 | * | clone1018 joined #nim |
01:41:48 | * | ekarlso joined #nim |
01:41:48 | * | jsudlow joined #nim |
01:41:48 | * | delian66 joined #nim |
01:41:48 | * | dhasenan_ joined #nim |
01:41:48 | * | vince- joined #nim |
01:41:48 | * | jj2baile joined #nim |
01:41:48 | * | chewbranca joined #nim |
01:41:48 | * | xandy joined #nim |
01:41:48 | * | buMPnet_ joined #nim |
01:41:48 | * | def- joined #nim |
01:41:48 | * | Zuchto joined #nim |
01:41:48 | * | rektide_ joined #nim |
01:41:48 | * | Amrykid joined #nim |
01:41:48 | * | ldlework joined #nim |
01:46:23 | * | janprill joined #nim |
01:52:42 | * | rektide__ joined #nim |
01:53:02 | * | reem quit (Remote host closed the connection) |
01:53:23 | * | darkf joined #nim |
01:54:06 | * | reem joined #nim |
01:54:15 | * | Gonzih joined #nim |
01:56:02 | * | rektide_ quit (Max SendQ exceeded) |
01:57:40 | * | reem quit (Remote host closed the connection) |
01:59:32 | * | 32NABEVRL joined #nim |
01:59:33 | * | clone1018_ joined #nim |
01:59:33 | * | MyMind joined #nim |
01:59:33 | * | Sornaensis joined #nim |
02:04:15 | * | brson quit (Ping timeout: 246 seconds) |
02:06:44 | * | chemist69_ joined #nim |
02:09:52 | * | chemist69 quit (Ping timeout: 245 seconds) |
02:10:42 | * | 32NABEVRL quit (*.net *.split) |
02:10:42 | * | clone1018_ quit (*.net *.split) |
02:10:42 | * | MyMind quit (*.net *.split) |
02:10:42 | * | Sornaensis quit (*.net *.split) |
02:16:29 | * | 32NABEVRL joined #nim |
02:16:29 | * | clone1018_ joined #nim |
02:16:29 | * | MyMind joined #nim |
02:16:29 | * | Sornaensis joined #nim |
02:16:41 | * | clone1018_ quit (Max SendQ exceeded) |
02:17:06 | * | clone1018_ joined #nim |
02:17:18 | * | MyMind quit (Max SendQ exceeded) |
02:19:19 | * | MyMind joined #nim |
02:27:36 | * | nande quit (Remote host closed the connection) |
02:31:52 | * | Demos joined #nim |
02:41:47 | * | kapil___ joined #nim |
02:42:55 | * | n0x0ff left #nim (#nim) |
02:44:14 | * | fizzbooze quit (Quit: WeeChat 1.1.1) |
02:53:19 | * | Trustable quit (Remote host closed the connection) |
03:07:32 | * | awesomo4000_ joined #nim |
03:07:44 | * | aidanh quit (Ping timeout: 256 seconds) |
03:09:04 | * | aidanh joined #nim |
03:10:04 | * | awesomo4000 quit (Ping timeout: 244 seconds) |
03:10:04 | * | awesomo4000_ is now known as awesomo4000 |
03:17:13 | * | girvo quit (Ping timeout: 264 seconds) |
03:20:51 | onionhammer | argh omg these nimnode warnings gotta go |
03:29:01 | * | Boscop quit (Ping timeout: 252 seconds) |
03:29:13 | * | lyro quit (Ping timeout: 264 seconds) |
03:30:04 | * | lyro joined #nim |
03:30:21 | * | ChrisMAN quit (Ping timeout: 246 seconds) |
03:30:55 | * | nimnoob123 joined #nim |
03:31:16 | * | Boscop joined #nim |
03:31:28 | nimnoob123 | have to admit, having way too much fun messing around w/ sdl2 and nim |
03:45:13 | * | fizzbooze joined #nim |
03:57:19 | * | lyro quit (Ping timeout: 245 seconds) |
03:57:42 | * | madlord joined #nim |
03:57:52 | * | madlord left #nim (#nim) |
03:58:15 | * | madlord joined #nim |
03:58:56 | * | lyro joined #nim |
03:59:31 | * | madlord left #nim (#nim) |
04:09:38 | * | reem joined #nim |
04:12:15 | * | brson joined #nim |
04:13:37 | * | girvo joined #nim |
04:17:56 | * | girvo quit (Ping timeout: 246 seconds) |
04:19:38 | Triplefox | tried to compile my sdl2 app with --app:gui so that it has no console but ld is failing: |
04:19:39 | Triplefox | C:/Nim/dist/mingw/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lgdi32 |
04:19:39 | Triplefox | C:/Nim/dist/mingw/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lcomdlg32 |
04:19:52 | Triplefox | something i have to install? |
04:23:02 | * | reem quit (Remote host closed the connection) |
04:31:01 | TEttinger | gdi should be present on windows... |
04:31:31 | TEttinger | it's how all software-rendered drawing typically is done with windows APIs |
04:34:39 | TEttinger | hm https://bugs.launchpad.net/nimrod/+bug/540795 |
04:36:03 | TEttinger | ah, but gdi isn't always present in a way that mingw can load it... |
04:38:19 | * | saml_ quit (Quit: Leaving) |
04:42:30 | * | reem joined #nim |
04:44:18 | * | reem quit (Remote host closed the connection) |
04:52:30 | * | pregressive quit (Remote host closed the connection) |
04:53:03 | * | pregressive joined #nim |
04:57:31 | * | pregressive quit (Ping timeout: 250 seconds) |
05:00:34 | * | girvo joined #nim |
05:03:38 | * | reem joined #nim |
05:10:47 | * | awesomo4000 left #nim (#nim) |
05:10:57 | * | awesomo4000 joined #nim |
05:28:21 | * | kashyap_ joined #nim |
05:28:42 | * | Demos quit (Read error: Connection reset by peer) |
05:44:00 | * | BlaXpirit joined #nim |
05:44:10 | * | milosn quit (Ping timeout: 265 seconds) |
05:45:44 | * | milosn joined #nim |
05:57:13 | * | brson quit (Quit: leaving) |
06:15:52 | * | Menche quit (Ping timeout: 240 seconds) |
06:16:00 | * | nimnoob123 quit (Quit: Page closed) |
06:41:02 | * | fungos quit (Ping timeout: 246 seconds) |
06:46:48 | * | sillesta joined #nim |
06:47:38 | * | BlaXpirit quit (Quit: Quit Konversation) |
06:48:37 | * | Menche joined #nim |
07:09:46 | * | RayoGundead joined #nim |
07:10:06 | * | wtw joined #nim |
07:10:11 | * | wtw left #nim (#nim) |
07:10:29 | * | wtw joined #nim |
07:20:07 | * | RayoGundead quit (Ping timeout: 246 seconds) |
07:24:47 | * | fizzbooze quit (Ping timeout: 244 seconds) |
07:25:37 | * | gsingh93 quit (Ping timeout: 264 seconds) |
07:33:45 | * | shalabh quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
07:34:16 | * | shalabh joined #nim |
07:36:10 | * | awesomo4000 quit (Quit: awesomo4000) |
07:40:01 | * | reem quit (Remote host closed the connection) |
07:44:25 | * | reem joined #nim |
07:48:57 | * | ekarlso quit (Ping timeout: 256 seconds) |
07:54:03 | * | Outlander quit (Ping timeout: 250 seconds) |
07:54:10 | * | chemist69_ quit (Quit: WeeChat 1.1.1) |
07:54:20 | * | chemist69 joined #nim |
07:58:04 | * | girvo quit (Ping timeout: 272 seconds) |
08:04:40 | * | dumdum joined #nim |
08:16:07 | * | TEttinger quit (Ping timeout: 252 seconds) |
08:21:52 | Triplefox | downloading winbuilds and completely replacing dist/mingw with a full install from that worked |
08:25:06 | * | bjz joined #nim |
08:25:19 | * | janprill quit () |
08:35:55 | * | bjz quit (Ping timeout: 252 seconds) |
08:53:33 | * | awesomo4000 joined #nim |
08:54:06 | * | ekarlso joined #nim |
08:54:36 | * | girvo joined #nim |
08:58:52 | * | girvo quit (Ping timeout: 240 seconds) |
09:02:51 | * | bjz joined #nim |
09:04:48 | novist | does var int parameter of proc make a copy or modifies a reference of passed variable? |
09:05:48 | novist | ah hmm doc says yes |
09:05:53 | novist | my code says no heh |
09:07:23 | Triplefox | var int i think should be passing in a reference...i find it very hard to keep track of which things are copied in nim though |
09:08:23 | novist | actually was my fault. created new variable on local stack by accident. i feel lame.. |
09:10:00 | Triplefox | i find myself wanting some annotation or compile-time check that ensures i'm doing what i think i'm doing |
09:11:22 | * | reem quit (Remote host closed the connection) |
09:12:51 | Triplefox | (it's probably possible to get what i want if i knew my way around the api better) |
09:13:50 | awesomo4000 | is there a nim library similar to libmagic for file type identification |
09:17:20 | * | gokr joined #nim |
09:23:46 | * | reem joined #nim |
09:24:06 | * | tumult joined #nim |
09:26:32 | * | DecoPerson joined #nim |
09:30:35 | * | Trustable joined #nim |
10:01:20 | * | reem quit (Remote host closed the connection) |
10:04:48 | * | reem joined #nim |
10:11:57 | * | pafmaf joined #nim |
10:24:15 | * | Outlander joined #nim |
10:25:25 | novist | this is crashing... can anyone see anything that would be obviously wrong with this bit of code? https://paste2box.com/6/#/oJrWGQ/zM8S_KMo6BHonZ3CUHQsN2tYMPc9Z30yJN9S7aH5qtk/fU4A3E08.txt |
10:31:23 | * | pafmaf quit (Quit: This computer has gone to sleep) |
10:32:53 | * | MightyJoe quit (Ping timeout: 240 seconds) |
10:33:51 | * | Jehan_ joined #nim |
10:34:51 | Jehan_ | novist: Drop the `var` from the result of the anonymous proc. |
10:35:11 | novist | hmm.. could you explain whats the difference? |
10:35:29 | * | girvo joined #nim |
10:36:49 | Jehan_ | That said, it shouldn't crash, but raise a compile-time error. |
10:37:01 | * | MightyJoe joined #nim |
10:37:10 | novist | my guess would be.. var in return statement creates result on local stack and returns ref to it? |
10:37:27 | Jehan_ | Well, a `var ref T` returns a pointer to a variable referencing an instance of T. |
10:37:59 | Jehan_ | When doing `new(result)`, there is no variable that this can point to. |
10:38:25 | novist | i see. thanks for clearing this up |
10:38:45 | Jehan_ | But yeah, this should really raise an error at compile time. |
10:40:01 | * | girvo quit (Ping timeout: 250 seconds) |
10:46:13 | * | MajorWork joined #nim |
10:46:37 | * | MajorWork quit (Changing host) |
10:46:37 | * | MajorWork joined #nim |
10:59:07 | * | gokr1 joined #nim |
11:02:07 | * | gokr quit (Ping timeout: 250 seconds) |
11:12:22 | novist | and if anyone would help me solve problem stated in last post at http://forum.nim-lang.org/t/703/4 i would be most grateful |
11:13:30 | * | pafmaf joined #nim |
11:14:43 | * | reem quit (Remote host closed the connection) |
11:15:19 | * | pafmaf quit (Client Quit) |
11:28:42 | Jehan_ | novist: As far as I can tell, the macro contains a StmtList that contains a new(MyType) call whose result isn't used. |
11:28:57 | Jehan_ | ... the macro expansion ... |
11:29:32 | novist | new(result) places result into "result" directly |
11:30:04 | novist | it seems to me result of anonymous proc somehow isnt being assigned to "var a" |
11:32:00 | novist | "make" macro gets call statement, returns statement list with call statement. so returned stuff in statement list should replace "new MyType(1)", thats how i understand it |
11:32:05 | novist | maybe its wrong assumption? |
11:33:43 | Jehan_ | new(SomeType) is different in that it returns an instance of SomeType. |
11:36:16 | * | girvo joined #nim |
11:37:25 | novist | oh lol thats right! i missed that bit when correcting AST |
11:37:26 | novist | thanks! |
11:41:51 | * | girvo quit (Ping timeout: 256 seconds) |
11:55:23 | * | gokr1 quit (Quit: Leaving.) |
12:01:45 | Araq | awesomo4000: I don't think so but we have limited support for mimetypes in the stdlib |
12:03:26 | def- | awesomo4000: also note that you're not supposed to use libmagic on untrusted files, there were a few security vulnerabilities recently |
12:09:29 | Araq | not to mention that you should file extensions for file type detection IMHO |
12:10:10 | Araq | not every file has some magic file type header |
12:10:12 | * | edayo_ joined #nim |
12:18:58 | awesomo4000 | so if libmagic has a vulnerability, then a program written in nim that uses libmagic must have this vulnerability as well ? |
12:20:01 | flaviu | awesomo4000: The vulnerability has probably been fixed already. Just make sure to dynamically link. |
12:21:29 | awesomo4000 | there two vulns with cves for libmagic cve-2014-2270 and cve-2012-1571 . both are dos . one was in parsing PE executables, the other CDF files |
12:24:02 | awesomo4000 | is there a mechanism to safely use vulnerable c code in a program written in nim |
12:28:59 | flaviu | No, how would something like that work? I mean you could execute the executable in an interpreter, but that sounds like a PITA to implement. |
12:29:45 | awesomo4000 | symbolic execution is definitely an area of research |
12:30:53 | awesomo4000 | it is being increasingly used in vulnerability research. |
12:31:20 | flaviu | But that's a form of verification, not sandboxing. |
12:32:14 | awesomo4000 | as a design goal, nim seeks to eliminate as many errors as possible at compile time, right ? |
12:33:29 | awesomo4000 | but as soon as soon as i’m accepting input from a vulnerable c library, it all goes out the window |
12:33:46 | flaviu | Sure, but what does have to do with sandboxing C code? Nim *can't* and doesn't care about how external C libraries are implemented. |
12:36:17 | flaviu | If you want something like this, it'd be better to go to the clang mailing list. They're the one in a position to verify all C code, not Nim. |
12:36:22 | flaviu | anyway, got to go. |
12:39:06 | Araq | awesomo4000: this is not different when you use a C lib from Java or C# or Smalltalk really. for protection you have to invoke an external *process* and communicate via pipes. that's usually a pita on every OS, but you have few other choices |
12:39:54 | awesomo4000 | is there a good doc about the prover in nim |
12:40:45 | Araq | no, there is a gsoc project that aims to improve and document it |
12:41:35 | awesomo4000 | the prover allows claims about side effects from parallelizing code, right ? |
12:41:58 | Araq | right |
12:44:24 | awesomo4000 | do you follow the formal methods research |
12:45:14 | Araq | yes as far as my spare time allows me to do that |
12:45:51 | awesomo4000 | cool. so.. ur/web , coq, isabelle , and all that . |
12:46:44 | awesomo4000 | seems like that type of thing is becoming more accessible |
12:47:30 | Araq | yeah it's definitely something to watch |
12:48:10 | Araq | but Nim has more modest goals than "nim seeks to eliminate as many errors as possible at compile time" |
12:48:34 | Araq | that's better left to ATS ;-) |
12:50:25 | awesomo4000 | what made you want to introduce the parallel builtin |
12:50:57 | Araq | I thought it's easy to do and mostly overlooked by the scientific community |
12:53:35 | * | ronchilla__ joined #nim |
12:54:11 | Araq | bbl |
12:54:27 | awesomo4000 | what would you do next similar to parallel |
12:55:53 | * | edayo_ quit (Ping timeout: 246 seconds) |
12:57:30 | * | wb__ joined #nim |
12:58:35 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:00:53 | * | wb_ quit (Ping timeout: 240 seconds) |
13:02:33 | * | Jehan_ quit (Quit: Leaving) |
13:12:43 | * | bjz joined #nim |
13:16:07 | * | ChrisMAN joined #nim |
13:25:54 | * | girvo joined #nim |
13:28:04 | * | BlaXpirit joined #nim |
13:29:57 | * | wb_ joined #nim |
13:30:30 | * | girvo quit (Ping timeout: 252 seconds) |
13:33:03 | * | pafmaf_ joined #nim |
13:33:11 | * | wb__ quit (Ping timeout: 250 seconds) |
13:37:09 | ekarlso | so for some reason when you symlink to the compiler binary Araq lik nim > /bin/nim and then run nim c foo.nim it fails to find lib/system.nim |
13:42:52 | * | emilsp joined #nim |
13:45:41 | Araq | awesomo4000: I am not sure I understand your question, but pcwalton claims "Rust can do similar things with its ownership type system" |
13:55:04 | awesomo4000 | the parallel statement and requirement for the following code gives one kind of safety.. was just wondering if something similar could be done for other problematic areas in programs, plugging in different types of proving algorithms |
13:57:56 | * | mpthrapp joined #nim |
13:58:16 | * | BitPuffin joined #nim |
13:58:59 | * | itPuffinB joined #nim |
14:00:09 | * | tPuffinBi joined #nim |
14:00:49 | * | PuffinBit joined #nim |
14:01:29 | * | uffinBitP joined #nim |
14:02:39 | * | BitPuffin quit (Ping timeout: 250 seconds) |
14:03:31 | * | itPuffinB quit (Ping timeout: 250 seconds) |
14:03:34 | * | BitPuffin joined #nim |
14:04:23 | * | tPuffinBi quit (Ping timeout: 250 seconds) |
14:05:15 | * | PuffinBit quit (Ping timeout: 250 seconds) |
14:06:07 | * | uffinBitP quit (Ping timeout: 250 seconds) |
14:08:03 | * | BitPuffin quit (Ping timeout: 256 seconds) |
14:11:22 | * | BitPuffin joined #nim |
14:11:40 | * | BlaXpirit quit (Quit: Quit Konversation) |
14:13:26 | * | BlaXpirit joined #nim |
14:13:42 | Araq | awesomo4000: well sure, you can do a lot. and there are lots of different aspects when it comes to "safety" |
14:15:16 | * | reem joined #nim |
14:15:31 | novist | so i have a macro which needs to know if proc is defined. proc definition should be valid at time macro is called, not at time where macro is defined. and i have AST of the call i would like to test. is this possible? basically like compiles() except with AST. i tried compiles() on stmtList and it returns true regardless.. so in that case it checks only syntax i suppose. what im trying to do here is call init() proc if it exists only. |
14:15:32 | novist | ofc init() can be overloaded for various object types so arguments need checking too. can this be somehow achieved? |
14:16:22 | Araq | awesomo4000: http://xkcd.com/1200/ is my favourite xkcd ;-) |
14:17:43 | * | MajorWork quit (Quit: Leaving) |
14:19:22 | * | ChrisMAN quit (Remote host closed the connection) |
14:19:52 | * | reem quit (Ping timeout: 245 seconds) |
14:20:18 | Araq | novist: you can make the macro *generate* the compiles check |
14:20:46 | novist | oh that would work, thanks for idea |
14:26:04 | * | kashyap_ quit (Ping timeout: 246 seconds) |
14:32:04 | novist | hmm Araq compiles() appears to return true even if proc is not declared/defined |
14:32:37 | * | jfchevrette joined #nim |
14:32:38 | Araq | that's bad :P report it |
14:33:02 | novist | sir yes sir o7 :D |
14:38:58 | novist | err actually.. im supposed to use "when" instead of "if" with "compiles"? |
14:39:23 | Araq | yes |
14:40:33 | novist | and it suddenly works. problem was connection between keyboard and chair |
14:43:11 | * | jfchevrette quit (Ping timeout: 256 seconds) |
14:45:05 | novist | hey Araq.. i noticed one odd thing.. not that its important, just curious. same things are defined in macros.nim and in compiler src, same enums etc, just names bit different. think in the future it could be unified? like compiler and macros using stuff defined in the same file? |
14:48:10 | * | BlaXpirit quit (Read error: Connection reset by peer) |
14:48:26 | Araq | yeah but these things usually would save me 3 seconds a year |
14:48:56 | * | BlaXpirit joined #nim |
14:51:19 | awesomo4000 | what is the idiom for a set of strings |
14:51:50 | ekarlso | Araq: you got a clue ? |
14:52:01 | def- | awesomo4000: set like hashset? http://nim-lang.org/sets.html |
14:52:21 | Araq | ekarlso: why would I? I don't use symlinks |
14:53:14 | ekarlso | Araq: how would you go about installing nim into /bin ? |
14:53:32 | Araq | I don't install it into /bin. |
14:54:07 | Araq | unix works much better when you don't use its features. |
14:54:28 | * | sepisoad joined #nim |
14:55:03 | awesomo4000 | i guess that will work. i really just want a list of unique strings |
14:55:06 | dom96 | Notch mentioned Nim: https://twitter.com/notch/status/570578610618298368 |
14:55:51 | sepisoad | hey there, i'm writing a simple cli based password manager, it's far from being awesome, but hey i'm having fun coding in nim lang, it'd be nice if you give me some advices since i'm almost new to nim |
14:55:57 | sepisoad | https://github.com/sepisoad/condooj |
14:57:23 | BitPuffin | dom96: hey man thanks for the credit |
14:58:11 | dom96 | BitPuffin: sorry, thought you weren't here. |
14:58:22 | BitPuffin | haha |
14:58:27 | BitPuffin | best apology |
14:58:38 | BitPuffin | hey man, thought you weren't here so you wouldn't notice me taking credit :D |
14:58:42 | BitPuffin | I'm not really serious though |
14:58:43 | BitPuffin | carry on |
14:58:48 | BitPuffin | :P |
14:58:49 | BitPuffin | <3 |
15:00:06 | Araq | dom96: does he want to sponsor us? |
15:00:57 | * | sepisoad quit (Quit: Leaving) |
15:01:05 | BitPuffin | Araq: he doesn't like significant whitespace |
15:01:55 | reactormonk | Time to implement the non-significant syntax? |
15:02:42 | dom96 | "Nim still has the undefined behaviors that C has. E.g., null pointer deference is still undefined behavior in Nim." that doesn't sound true, is it? |
15:02:43 | BitPuffin | and the JVM backend |
15:03:05 | BitPuffin | dom96: think you get an exception if you deref a null ptr |
15:03:13 | BitPuffin | maybe not with a ptr though, perhaps only ref |
15:03:16 | BitPuffin | but I don't know |
15:03:18 | dom96 | BitPuffin: That's not "undefined behaviour" |
15:03:47 | def- | dom96: it is: https://news.ycombinator.com/item?id=9050999 |
15:04:00 | BitPuffin | dom96: if you don't get an exception it's undefined behaviour for sure |
15:04:11 | BitPuffin | or maybe not for sure |
15:04:26 | BitPuffin | if the spec says ALWAYS SEGFAULT, or something, then I guess it's defined behaviour lol |
15:04:38 | def- | BitPuffin: look at the example, doesn't segfault with clang |
15:04:59 | * | gtrundle joined #nim |
15:05:28 | def- | signed integer overflow is also undefined |
15:06:32 | BitPuffin | def-: yeah, you're right |
15:06:46 | gtrundle | Araq: not sure what to think of this, given what you've said about 'not nil' limitations: https://gist.github.com/GrundleTrundle/4dba00f319d9e098264d |
15:08:58 | dom96 | that sounds like a problem |
15:11:25 | Araq | gtrundle: report it |
15:14:36 | * | girvo joined #nim |
15:18:09 | gtrundle | done, thanks. |
15:18:52 | * | girvo quit (Ping timeout: 240 seconds) |
15:19:44 | * | darkf quit (Quit: gn) |
15:21:33 | * | pregressive joined #nim |
15:21:50 | * | pafmaf_ quit (Quit: This computer has gone to sleep) |
15:23:31 | * | pregressive quit (Remote host closed the connection) |
15:23:54 | * | pregressive joined #nim |
15:25:41 | Araq | "Nim still has the undefined behaviors that C has. E.g., null pointer deference is still undefined behavior in Nim." |
15:27:23 | Araq | for me that's just "I read something in the internet and I cannot imagine it's a nonissue that can be fixed in 2 days" |
15:41:28 | Araq | last time I checked Nim had --nilChecks:on|off (unimplemented) |
15:42:02 | Araq | but whatever, obviously a guy who is heavily involved in Rust is trustworthy |
15:42:12 | Araq | when he talks about Nim |
15:44:12 | tumult | how would this be 'fixed', if it is classed as an issue? Would you class null refs as a compile error? I would have expected that to be quite complex but I have no idea. |
15:46:00 | tumult | pcwalton does like to make a big deal of safety but as you say, he's working on a language where that is it's main selling point |
15:46:28 | Araq | you simply raise an exception or call "quit". in other words the compiler has to ensure it crashes |
15:46:57 | Araq | note that it's about *undefined* behaviour and not about *desirable* behaviour |
15:48:06 | tumult | ah i see good point |
15:51:26 | * | pafmaf joined #nim |
15:53:49 | * | gokr joined #nim |
15:53:51 | * | gokr quit (Read error: Connection reset by peer) |
15:55:51 | Araq | hrm it looks like I removed --nilChecks:on|off at some point :-) |
15:56:01 | Araq | since it's not implemented |
15:56:26 | Araq | so ... I guess I cannot blame people for not knowing it |
15:57:16 | * | jfchevrette joined #nim |
16:03:43 | * | tumult quit (Ping timeout: 246 seconds) |
16:03:54 | * | tumult joined #nim |
16:04:01 | tumult | also, when/if implemented, would raising an error for nil access remove most of the C-related UB people are mentioning? |
16:06:24 | def- | you can enable overflow checks already |
16:07:02 | * | zahary quit (Read error: Connection reset by peer) |
16:08:40 | Araq | not to mention that generating (NI)((NU) a + (NU)b) is easy to do. there is a world of difference between *generating* C and writing it by hand |
16:13:32 | tumult | I must say it did strike me as disingenuous to imply that because C can raise UB, generated C must therefore also do this. |
16:14:18 | * | gtrundle quit (Quit: Leaving) |
16:14:59 | Araq | well it's true that in general we are not concerned about C's UB too much and it's not of a high priority for me |
16:15:27 | Araq | there is a difference between what the C standard says and what implementations really do |
16:15:45 | Araq | I consider the C standard to be mostly worthless |
16:16:25 | Araq | for instance, in C structs can have holes and iirc these might have undefined values |
16:16:33 | * | zahary joined #nim |
16:16:43 | Araq | so you cannot do memcmp a struct |
16:16:55 | tumult | that's interesting, did not know that |
16:17:23 | Araq | the C standard is defective to a point where it cannot be taken seriously |
16:17:47 | Araq | hence we have a list of "supported C compilers" and care more about the real world |
16:18:40 | tumult | to be honest and IMHO, accessing nil pointers is a programming error not a fault of a language. |
16:18:53 | emilsp | Araq, have you mentioned these remarks on #C ? :) |
16:22:58 | Araq | emilsp: no why would I? i have better things to do. |
16:24:05 | emilsp | Araq, very true. I guess encouraging trolling is not really productive, especially when people here want to popularize nim. |
16:24:58 | Araq | oh yeah that |
16:25:12 | onionhammer | Araq all those NimNode warnings fixed yet? :) |
16:25:21 | onionhammer | Im afraid to get latest |
16:25:32 | Araq | onionhammer: can't without breaking compatibility |
16:25:44 | onionhammer | so they're just in there forever huh |
16:25:47 | onionhammer | macros.nim cant be fixed |
16:25:58 | Araq | well I can fix it |
16:26:07 | Araq | but then I need to regenerate C sources |
16:26:19 | * | nande joined #nim |
16:26:24 | Araq | since it breaks bootstrapping |
16:27:04 | onionhammer | the # of warnings is pretty crazy... |
16:27:21 | onionhammer | I cant even see my output anymore when i compile a hello world in sublime |
16:27:24 | Araq | I can disable them for the macros module I guess |
16:28:25 | Araq | emilsp: that's another problem. when I complain about other programming languages people tend to think it's because I have an agenda to bring Nim to everybody. |
16:30:00 | * | gsingh93 joined #nim |
16:41:34 | * | mpthrapp_ joined #nim |
16:43:53 | * | dumdum quit (Ping timeout: 256 seconds) |
16:44:04 | * | mpthrapp quit (Ping timeout: 255 seconds) |
16:45:42 | novist | this is good one. i rigged my macro to call init() if it exists (using compiles()) and output warning if it does not exist. in nested constructor call second constructor (Type2) for some reason does not output warning if it has no init() for it defined. However compiles() seems to pick that up just fine because no compilation error is output. In following example one init() is commented out and it should generate warning but does not. |
16:45:42 | novist | Commenting out first uncommented init() however makes warning for Type1 appear. is that how its supposed to work? cause thats totally not what i expect heh. https://paste2box.com/6/#/rZrWGQ/q6n9mVwxXtJHUFy-a0ZgdRWS9fg2yQ57Bwhiwg_vPZs/qjKqBBgt.txt |
16:47:49 | * | ronchilla__ quit (Ping timeout: 264 seconds) |
17:02:49 | * | mpthrapp joined #nim |
17:02:52 | * | tumult quit (Ping timeout: 246 seconds) |
17:03:20 | * | girvo joined #nim |
17:03:59 | mpthrapp | I'm trying to get nimble working on Windows Vista. I followed the instructions on github, and the first time I ran nimble it ran "chcp 65001" and now it does nothing. |
17:04:04 | mpthrapp | Any thoughts? |
17:04:33 | mpthrapp | I tried running nimble update, and it doesn't display an error, it just does nothing. |
17:06:11 | def- | mpthrapp: with the nimble binary or compiled from source? |
17:07:47 | * | girvo quit (Ping timeout: 252 seconds) |
17:08:38 | mpthrapp | def-: The binary. |
17:09:00 | * | awesomo4000 left #nim (#nim) |
17:16:11 | * | mpthrapp quit (Remote host closed the connection) |
17:16:15 | * | wb_ quit (Read error: Connection reset by peer) |
17:16:18 | * | mpthrapp_ is now known as mpthrapp |
17:18:37 | * | ChrisMAN joined #nim |
17:26:23 | mpthrapp | Also, when I try to install it on my windows 7 laptop, it says nim is not in path, despite it being in the path. |
17:27:08 | * | jholland quit (Quit: Connection closed for inactivity) |
17:27:56 | mpthrapp | Strike that, I thought it was in my path but it's not |
17:39:43 | mpthrapp | So, now it is in my path and there's no spaces in the path, and I still can't get nimble to install. :/ |
17:40:25 | def- | that's strange. maybe someone with windows experience can help |
17:40:53 | mpthrapp | Yeah, windows is a strange beast some times. :P |
17:41:12 | mpthrapp | In the meantime, how do I manually install a package? |
17:41:48 | mpthrapp | For example, I'm trying to install jester. Where do I put it in reference to the rest of my nim installation? Do I need to add it to path? |
17:42:29 | BlaXpirit | mpthrapp, i wouldn't bother, just put all needed libraries in project folder |
17:43:15 | mpthrapp | BlaXpirit: Oh, okay. So it should be projectroot/library/files? |
17:43:26 | mpthrapp | Or do I put the files right in projectroot? |
17:43:36 | BlaXpirit | you can put in projectroot |
17:43:44 | mpthrapp | Okay. |
17:43:48 | BlaXpirit | but there is always --path argument to nim compiler |
17:43:56 | BlaXpirit | which can also be factored out to nim.cfg |
17:46:56 | mpthrapp | Okay, got it all working. :) Followup, is there a good jester tutorial? |
17:48:15 | def- | mpthrapp: https://github.com/dom96/jester and http://www.eoleary.me/ |
17:49:03 | mpthrapp | def-: Yeah, I'm reading through the stuff on Github, and I was hoping there was something more in depth, which the second link looks like it is. Thanks. :) |
17:54:03 | * | wb joined #nim |
17:56:42 | mpthrapp | Hmmm, I'm trying to compile the hello world in the jester readme, and I'm getting this stacktrace. https://bpaste.net/show/ee89db4eb506 It says it's unable to find a file, but it doesn't say which one. |
17:57:51 | mpthrapp | jester_server.c is in my nimcache in the folder I'm compiling in. |
17:58:07 | BlaXpirit | now it's probably a problem with finding compiler |
17:58:22 | BlaXpirit | i'd say 0.10.2 installer has quite a lot of problems |
17:58:45 | mpthrapp | BlaXpirit: Possibly. I'm using aporia's compile. Would I possibly have better luck with the cli? |
17:59:02 | mpthrapp | BlaXpirit: And if so, what flags should I be using? |
17:59:10 | BlaXpirit | it's all supposed to work as is |
17:59:25 | BlaXpirit | anyho |
17:59:27 | BlaXpirit | w |
17:59:43 | * | Matthias247 joined #nim |
18:00:51 | mpthrapp | Yeah, it seems to be an issue with compiling Jester. |
18:01:28 | BlaXpirit | i'm talking about C compiler |
18:01:44 | * | fizzbooze joined #nim |
18:01:50 | BlaXpirit | i'm gonna go ahead and write some instructions. |
18:02:24 | mpthrapp | Awesome, thanks. |
18:08:47 | BlaXpirit | mpthrapp, but first of all, did you check MinGW compiler during installation? |
18:09:01 | * | UberLambda joined #nim |
18:09:06 | * | UberLambda quit (Client Quit) |
18:09:13 | mpthrapp | I did. |
18:09:25 | mpthrapp | I installed everything, docs, mingw, aporia, etc. |
18:10:12 | * | pafmaf quit (Quit: This computer has gone to sleep) |
18:11:59 | mpthrapp | Yeah, it definitely seems to be an issue with the compiler, because I made a new file in a new directory that's just echo "Hello World" and I get the same error. |
18:13:30 | mpthrapp | The only thing I can think of is that it's trying to add users\me\.babel and \.nimble, neither of which exist. |
18:15:08 | BlaXpirit | mpthrapp, everything should've been added to PATH automatically |
18:15:20 | BlaXpirit | the problem is if you added it manually, you most likely didnt add path to compiler |
18:15:44 | mpthrapp | BlaXpirit: I have C:\nim\bin in my PATH |
18:16:06 | BlaXpirit | should be C:\Nim\dist\mingw;C:\Nim\dist\mingw\bin;C:\Nim\bin;C:\Nim\dist\babel |
18:16:20 | mpthrapp | Ahhh, okay. Thanks. |
18:16:40 | BlaXpirit | the question remains why the stuff wasn't added to PATH automatically |
18:17:22 | mpthrapp | It could be an admin issue? Or maybe it's being virtualized and not getting access to the registry? |
18:17:40 | * | dumdum joined #nim |
18:19:10 | mpthrapp | Also, the nim compiler breaks if there's spaces in the path to a compiled file. :/ |
18:20:02 | mpthrapp | It's trying to compile workspace\hello_world\hello_world.nim instead of C:\nim workspace\hello_world\hello_world.nim |
18:20:13 | BlaXpirit | sucks |
18:20:50 | BlaXpirit | you're right |
18:21:11 | mpthrapp | It's possible it's unique to windows (i wouldn't be surprised. |
18:21:13 | mpthrapp | )* |
18:22:07 | BlaXpirit | mpthrapp, looks like it is |
18:22:23 | BlaXpirit | but i don't think windows is necessarily the one to blame |
18:23:18 | mpthrapp | If I wanted to submit a pull to fix this, where would I look? |
18:23:39 | BlaXpirit | it might even already be fixed, who knows |
18:23:53 | mpthrapp | BlaXpirit: Quite possible. |
18:24:41 | BlaXpirit | current devel branch seemed quite nice at least a week ago, may be worth making a release. so many fixes... |
18:26:54 | mpthrapp | I submitted a bug report on github. Hopefully it's fixed already and just needs a patch to be pushed. |
18:27:07 | mpthrapp | But either way, it's good to have the report. |
18:30:50 | * | Mat4 joined #nim |
18:30:52 | Mat4 | hi all |
18:33:00 | * | imapiekindaguy joined #nim |
18:38:09 | * | darithorn joined #nim |
18:41:59 | Araq | BlaXpirit: by definition there cannot be a release with open showstopper bugs |
18:47:50 | * | fizzbooze quit (Ping timeout: 256 seconds) |
18:52:08 | * | girvo joined #nim |
18:56:28 | * | girvo quit (Ping timeout: 252 seconds) |
19:06:24 | * | didlybom joined #nim |
19:06:40 | didlybom | Hi, I need some help using the selectors module |
19:06:51 | didlybom | is there some example or some blog with info about it? |
19:08:03 | def- | didlybom: what for? it's pretty low level. i was just playing around with it: https://github.com/def-/nim-unsorted/blob/master/selectors_hello.nim |
19:08:29 | didlybom | I am trying to port Python's telnetlib module into nim |
19:08:38 | didlybom | it is a pretty straightforward port |
19:08:45 | didlybom | I took the python code and fixed it as needed |
19:09:05 | didlybom | they use python's select module to detect activity on the sockets they open |
19:09:12 | didlybom | I was planning to do exactly the same |
19:10:37 | didlybom | but maybe I don't need to, since I'm using the net module, rather than rawsockets? |
19:11:42 | dom96 | didlybom: do you want to use asynchronous sockets or blocking sockets? |
19:13:11 | BlaXpirit | mpthrapp, as promised, installation instructions: http://blaxpirit.com/blog/8/avoid-problems-when-installing-nim-on-windows.html |
19:13:21 | didlybom | I didn't think much about it, to tell you the truth. I just used the net module's Socket type |
19:13:32 | mpthrapp | BlaXpirit: Awesome, thanks! |
19:14:53 | didlybom | can the net module do both? |
19:15:10 | didlybom | is the selectors module meant to be used with async sockets only? |
19:15:35 | dom96 | didlybom: The net module is only for blocking sockets, for asynchronous sockets you should be using the asyncnet module. |
19:15:46 | didlybom | I see |
19:16:32 | didlybom | I guess that given the telnet library usage there might not be a reason to use asynchronous sockets? |
19:17:43 | didlybom | although I see that the ftpclient module uses asyncnet |
19:17:47 | shalabh | hello |
19:17:55 | shalabh | can i have compile time globals? |
19:18:07 | BlaXpirit | uh sure |
19:18:27 | shalabh | how? any special syntax or keyword? |
19:18:28 | dom96 | didlybom: I'd say implement both. |
19:18:32 | BlaXpirit | i probably understood it differently than what you meant |
19:18:36 | dom96 | didlybom: Depends on your use case of course. |
19:18:43 | didlybom | why both? |
19:21:03 | * | brson joined #nim |
19:21:07 | Araq | shalabh: var foo {.compileTime.}: string |
19:21:58 | shalabh | Araq: thanks. I should have just tried it. Many things in Nim just seem to work when I try them. Reminds me of when I started using Python :D |
19:22:18 | Araq | ha that's news to me |
19:22:50 | Araq | but I'm biased since I mostly look at the bugs |
19:23:11 | Araq | nobody comes back to report "hey, this just works out of the box" ;-) |
19:23:26 | shalabh | well, those are not interesting reports :) |
19:23:43 | emilsp | my first experience with nim was rather different from yours, shalabh |
19:24:35 | shalabh | really? |
19:24:44 | shalabh | was it negative? |
19:24:58 | BlaXpirit | I agree to "Many things in Nim just seem to work when I try them" |
19:25:08 | BlaXpirit | but compiler bugs sometimes ruin that :| |
19:25:29 | shalabh | well I'm talking about basic stuff |
19:25:34 | * | nande quit (Remote host closed the connection) |
19:25:50 | * | zahary quit (Ping timeout: 265 seconds) |
19:26:50 | shalabh | for e.g. 'for x in MyEnum: echo x' |
19:26:51 | shalabh | just worked |
19:27:22 | shalabh | Araq:I vouched for Nim for GSOC |
19:27:30 | shalabh | hope you guys get it this year |
19:27:48 | Araq | shalabh: ah thank you! :-) |
19:28:08 | BlaXpirit | damn, i got 2 ideas for gsoc just today |
19:28:18 | didlybom | dom96: is there a reason why you asked if I planned to use blocking or async sockets? |
19:28:30 | didlybom | when using blocking sockets, do I need to use selectors at all? |
19:28:51 | dom96 | didlybom: Selectors is essentially async. |
19:29:02 | didlybom | ah, I see |
19:29:03 | dom96 | didlybom: asyncnet abstracts this |
19:29:10 | dom96 | didlybom: It uses the selectors module on Unix |
19:29:37 | didlybom | oh, then if I use either net or asyncnet I don't even need to care for selectors at all? |
19:31:41 | def- | didlybom: sounds right |
19:31:48 | didlybom | I see |
19:31:56 | def- | BlaXpirit: what ideas? |
19:31:59 | didlybom | ok, another question, if you guys don't mind |
19:32:24 | didlybom | I'm trying to create a thread |
19:33:41 | didlybom | simply doing: var thread: TThread |
19:33:53 | didlybom | but I get: Error: undeclared identifier: 'TThread' |
19:34:02 | didlybom | I also tried: var thread: Thread |
19:34:16 | Araq | --threads:on |
19:34:18 | def- | compile with --threads:on |
19:34:23 | didlybom | ah |
19:35:07 | didlybom | Ummm |
19:35:29 | didlybom | I should have read the threads module docs more carefully. It is right there on the second line! :-P |
19:35:43 | didlybom | Is there a reason why this must be enabled and is not enabled by default? |
19:35:46 | dom96 | if you want threads then you should use blocking sockets, there is currently a bug in the async implementation (or in the threads implementation) which prevents both being used simultaneously. |
19:36:10 | didlybom | ok |
19:36:12 | didlybom | I see |
19:36:13 | didlybom | thanks a lot |
19:36:25 | didlybom | I gotta go (the kid is calling) but thanks a lot for your help |
19:36:33 | didlybom | hopefully I'll see you guys around again |
19:36:34 | didlybom | bye! |
19:36:47 | dom96 | no worries, see ya |
19:43:31 | * | dumdum quit (Ping timeout: 256 seconds) |
19:44:55 | * | didlybom quit (Ping timeout: 246 seconds) |
19:45:16 | * | elbow_jason joined #nim |
19:52:06 | * | gsingh93 quit (Ping timeout: 264 seconds) |
19:57:28 | * | imapiekindaguy quit (Quit: WeeChat 1.2-dev) |
20:12:22 | * | BitPuffin quit (Ping timeout: 245 seconds) |
20:18:22 | * | pregressive quit () |
20:22:15 | * | gsingh93 joined #nim |
20:27:18 | * | Mat4 quit (Remote host closed the connection) |
20:28:35 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
20:40:54 | * | girvo joined #nim |
20:45:23 | * | girvo quit (Ping timeout: 250 seconds) |
20:52:19 | * | pafmaf joined #nim |
20:55:45 | * | alexruf joined #nim |
20:57:58 | * | irrequietus joined #nim |
20:58:21 | * | TEttinger joined #nim |
20:59:40 | * | Matthias247 quit (Quit: Matthias247) |
21:03:50 | elbow_jason | has anyone tried doing anything with arduinos in nim? |
21:04:11 | * | fizzbooze joined #nim |
21:04:28 | Araq | perhaps Mat4 but he already left for today |
21:05:13 | elbow_jason | ok. I'll look for him tomorrow. |
21:11:16 | * | reem joined #nim |
21:17:54 | * | jfchevre_ joined #nim |
21:18:43 | * | bjz joined #nim |
21:21:16 | * | jfchevrette quit (Ping timeout: 255 seconds) |
21:21:46 | elbow_jason | where to look to compilation of the AST to JavaScript? |
21:22:03 | elbow_jason | argh... worst English ever |
21:22:20 | def- | compiler/jsgen.nim |
21:22:39 | elbow_jason | def-: thx |
21:26:05 | * | pafmaf quit (Quit: This computer has gone to sleep) |
21:29:33 | * | alexruf quit (Quit: Textual IRC Client: www.textualapp.com) |
21:31:09 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:37:42 | * | Matthias247 joined #nim |
21:42:28 | * | ehaliewicz joined #nim |
21:42:54 | * | Mat4 joined #nim |
21:43:45 | Araq | hi Mat4 elbow_jason has a question for you |
21:44:19 | elbow_jason | Mat4: Hi. I was wondering if you've done any work with Nim and Arduino? |
21:44:41 | elbow_jason | Araq: thanks for the heads up :) |
21:46:06 | * | Menche quit (Remote host closed the connection) |
21:58:36 | * | reem quit (Remote host closed the connection) |
22:01:47 | Mat4 | not yet |
22:04:10 | Mat4 | elbow_jason: No work done with Arduino yet |
22:05:19 | elbow_jason | Mat4: I'm taking a stab at it. (mostly thrashing at this point) |
22:05:35 | Mat4 | I'm primary interested to work with Parallax Propeller and PIC32 based boards |
22:06:29 | Mat4 | however, you will find Arduino easy to work with |
22:08:49 | * | mpthrapp quit (Remote host closed the connection) |
22:09:09 | elbow_jason | most of the guys sitting here (the hackerspace I'm sitting in) are Arduino veterans |
22:09:29 | * | reem joined #nim |
22:10:18 | elbow_jason | I think the hardest part at this point is figuring out what arduino's avr-gcc expects to see in a c file |
22:10:43 | Mat4 | as written, it's a nice platform for experimenting so long you use there Java based IDE |
22:11:42 | * | girvo joined #nim |
22:11:53 | elbow_jason | yea.. this thing is a monster. |
22:16:20 | Mat4 | take a look here: http://javiervalcarce.eu/wiki/Program_Arduino_with_AVR-GCC |
22:16:27 | * | girvo quit (Ping timeout: 265 seconds) |
22:16:35 | * | Outlander quit (Ping timeout: 246 seconds) |
22:18:44 | Mat4 | do you want to use Nim for development ? |
22:24:52 | * | fizzbooze quit (Ping timeout: 256 seconds) |
22:27:37 | elbow_jason | umm just playing around at the moment. |
22:30:32 | * | 32NABEVRL is now known as JStoker |
22:32:24 | * | girvo joined #nim |
22:42:50 | * | fizzbooze joined #nim |
22:42:54 | * | elbow_jason quit (Read error: Connection reset by peer) |
22:45:12 | * | elbow_jason joined #nim |
22:49:52 | * | irrequietus quit () |
22:50:20 | * | Outlander joined #nim |
23:00:47 | * | jfchevre_ quit (Quit: Textual IRC Client: www.textualapp.com) |
23:05:49 | Mat4 | ciao |
23:05:59 | * | Mat4 quit (Quit: Verlassend) |
23:25:16 | * | sillesta quit (Ping timeout: 244 seconds) |
23:29:02 | * | dv- quit (Ping timeout: 245 seconds) |
23:30:05 | * | dv- joined #nim |
23:36:55 | * | reem quit (Remote host closed the connection) |
23:48:42 | * | Demon_Fox joined #nim |
23:53:04 | * | elbow_jason quit (Remote host closed the connection) |
23:55:01 | * | Matthias247 quit (Read error: Connection reset by peer) |