00:00:01 | flaviu | nimnoob123: Also, if not foundyou.match(foostart): echo "yes" should work without problems. |
00:00:11 | nimnoob123 | :) |
00:00:48 | nimnoob123 | success! |
00:01:59 | nimnoob123 | btw a warning: c:\users\xxxxx\.nimble\pkgs\nre-0.6.1\nre.nim(383, 5) Hint: 'nre.renderBounds(str: string, bounds: Slice[system.int])' is declared but not used [XDeclaredButNotUsed] |
00:02:47 | fowl | flaviu, do you have a `=~` in nre |
00:04:19 | flaviu | fowl: Nope, but try let match = "assdsa".match(...); if match: ... |
00:04:55 | nimnoob123 | lib/pure/future.nim is official nim lib right? |
00:04:59 | BlaXpirit | yes |
00:05:17 | flaviu | Not as concise, I admit, but the readability benefits are worth it. |
00:05:33 | fowl | flaviu, i know how to do it, thats not convenient though |
00:05:42 | nimnoob123 | some of those libs throw PNimrodNode errors and other Nimrod deprecated errors |
00:06:13 | nimnoob123 | warnings* |
00:07:07 | nimnoob123 | since the name change im guessing |
00:07:45 | flaviu | fowl: Well, when type inference starts working, "aswdsad".match(...).map((match) => ...) is perfectly valid. |
00:07:53 | * | davidterry joined #nim |
00:08:43 | * | epichero joined #nim |
00:09:36 | Araq | and when the compiler gets an optimizer it's just as fast :P |
00:10:08 | Araq | I prefer to write libraries that work well with today's compiler though, but I know I'm a crank |
00:10:23 | flaviu | Yep! I think that's one of the most typical FPL optmizations. |
00:10:48 | flaviu | I feel the opposite way: it's not my responsibility as an API author to work around bugs. |
00:10:59 | BlaXpirit | fowl, flaviu: about =~ https://bpaste.net/show/3ed6834012e7 |
00:13:28 | Araq | one day I'll have the time to finish my regex implementation and give Nim: |
00:13:32 | Araq | match x: |
00:13:40 | Araq | of re"abc": ... |
00:13:47 | Araq | of re"xxyz": ... |
00:14:03 | Araq | and it's compiled like re2c does it |
00:14:12 | Araq | a real lexer generator |
00:14:24 | Araq | not that pcre crap |
00:14:34 | flaviu | Araq: Please expose hooks so that we can do our own custom pattern matching. |
00:14:56 | Araq | yeah, like Ragel? |
00:15:01 | flaviu | btw, PCRE has a JIT compiler, so it can be pretty fast. |
00:15:09 | Araq | btw I know that |
00:15:25 | * | brson quit (Ping timeout: 255 seconds) |
00:15:42 | flaviu | Maybe I should enable JIT by default in nre :> |
00:15:51 | flaviu | beat every other library in benchmarks. |
00:16:13 | Araq | it's still wrong, because you need to use 'if .. elif .. elif' and pcre cannot JIT accross these boundaries as it doesn't see them |
00:16:19 | * | davidterry quit (Ping timeout: 255 seconds) |
00:16:43 | Araq | you need to build the DFA as a whole |
00:17:08 | flaviu | What do you mean? |
00:18:43 | Araq | that you need to compile all the patterns into a single NFA/DFA to really optimize it |
00:19:05 | Araq | and you cannot do that with an API you need a DSL |
00:19:13 | flaviu | PCRE allows callbacks, so you can do all your branching within PCRE. |
00:19:39 | Araq | that's neat |
00:20:08 | Araq | a DSL is still better though :P |
00:27:03 | BlaXpirit | i don't think it's important at all |
00:29:05 | reactormonk | Araq, soooo ragel? |
00:37:44 | * | reem quit (Remote host closed the connection) |
00:38:16 | * | reem joined #nim |
00:41:49 | * | randomwalk quit (Ping timeout: 246 seconds) |
00:49:01 | * | reem quit (Remote host closed the connection) |
00:49:11 | * | davidterry joined #nim |
00:49:35 | * | reem joined #nim |
00:53:24 | * | randomwalk joined #nim |
00:53:53 | * | reem quit (Ping timeout: 246 seconds) |
00:56:44 | * | davidterry quit (Remote host closed the connection) |
00:59:36 | a5i | omg |
00:59:43 | a5i | is that the OG Araq? |
00:59:45 | a5i | Hi! |
01:01:55 | * | reem joined #nim |
01:03:29 | * | reem quit (Remote host closed the connection) |
01:06:41 | * | BlaXpirit quit (Quit: Quit Konversation) |
01:08:00 | reactormonk | a5i, o/ |
01:08:41 | a5i | \0 reactormonk |
01:10:35 | * | reem joined #nim |
01:14:21 | a5i | Hey reem :~D |
01:14:34 | ldlework | lol 'OG Araq' |
01:15:33 | randomwalk | def-: I notice that sequtils delete() does not return the seq. Can I do it some other way without your iterutils? Here's an example workaround with a temp variable: http://pastebin.com/UDxgXVUr |
01:16:25 | randomwalk | def-: I'm intentionally throwing the first line away. (I'm really parsing a csv file.) |
01:18:06 | randomwalk | a5i: I'm not sure if Araq will catch that cultural reference. :) |
01:18:57 | def- | randomwalk: you can always make your own returning version and call it "deleted" |
01:20:02 | randomwalk | def-: Ya, I'll do that. Then I can keep the "chain" in the for argument. |
01:20:32 | nimnoob123 | how do you connect to sites that use ssl through httpclient ? |
01:20:47 | def- | nimnoob123: compile with -d:ssl maybe |
01:20:53 | randomwalk | def-: Maybe iterutils will become standard. :) |
01:21:15 | nimnoob123 | ah neat |
01:21:19 | def- | first iterutils has to compile again :P |
01:22:23 | nimnoob123 | thanks def-, as usual |
01:28:50 | def- | nimnoob123: you're welcome, as usual |
01:29:04 | nimnoob123 | :) |
01:29:12 | randomwalk | I currently use a bare "discard" for nop placeholders. Is there a better way? |
01:29:27 | reactormonk | randomwalk, that's the way to go |
01:29:41 | * | Trustable quit (Remote host closed the connection) |
01:30:34 | randomwalk | reactormonk: I think I want to write a #define-like macro to alias discard...maybe to 1 unused char. :) |
01:31:15 | * | reem quit (Remote host closed the connection) |
01:31:19 | reactormonk | randomwalk, discard in nim ls like pass in python |
01:32:19 | randomwalk | reactormonk: I think I'll alias it to _ unless that's used for something else :) |
01:32:28 | reactormonk | randomwalk, _ is not a valid identifier |
01:32:37 | reactormonk | and please don't do that, it makes code harder to read |
01:32:58 | randomwalk | reactormonk: but it's just for my file...can't I macro it? |
01:33:25 | reactormonk | nope, not valid syntax. And don't do it, it makes code harder to read. And if your code is somewhat useful, other people will read it. |
01:33:53 | randomwalk | it reminds me of $_ in perl :) lol |
01:34:03 | * | reem joined #nim |
01:35:53 | randomwalk | no dice |
01:37:39 | nimnoob123 | hmm nre returns weird results |
01:38:24 | nimnoob123 | like the full output matches, but I have no clue how to grab the group from the find value, it just requires the first match of the full regex |
01:39:53 | flaviu | nimnoob123: I'm having trouble parsing your second message. Can you rephrase that/use pseudocode? |
01:39:56 | nimnoob123 | example: echo returned_html.findAll(re("<meta itemprop=\"og:customtag\" content=\"([^\"]+)\" />", "im")) returns the full html tag instead of the group |
01:40:39 | randomwalk | reactormonk: I agree. :) Underscore tends to obfuscate. |
01:40:42 | nimnoob123 | can't seem to figure out how to capture just the grouped regex in parenthesis |
01:40:56 | reactormonk | nimnoob123, https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/ |
01:41:23 | nimnoob123 | my regex is fine |
01:41:39 | randomwalk | nimnoob123 That's $1 or \1 ... I haven't tried regex in nim though |
01:42:00 | flaviu | reactormonk: That's not really helpful, there are cases when it's fine. nimnoob123: hmm, good point. |
01:42:01 | * | gsingh93 quit (Ping timeout: 250 seconds) |
01:42:09 | nimnoob123 | findAll in nre returns a sequence of matches, not $1 or \1 |
01:42:22 | nimnoob123 | seq[string] of matches * to be specific |
01:42:41 | flaviu | yep, and I think some clever API design can avoid that. I don't think you're the first to hit across that. |
01:42:44 | nimnoob123 | it's not capturing my groups at all, so yeah lol idk how to do it with nre :P |
01:43:06 | reactormonk | flaviu, yes, when you're controlling the html. And then you shouldn't need to di it. |
01:44:15 | flaviu | reactormonk: You can control the *ML even if you didn't generate it. |
01:44:26 | reactormonk | go on... |
01:44:41 | randomwalk | maybe you want findIter? |
01:45:01 | nimnoob123 | hmm |
01:45:09 | flaviu | reactormonk: If you know some *ML is generated by a specific tool, you know what sort of stuff it'll output. |
01:46:03 | reactormonk | flaviu, hm, I see your point. but then your tool kinda sucks |
01:46:09 | * | davidterry joined #nim |
01:46:25 | flaviu | reactormonk: Someone else chose the tool, you don't get any choice but to deal with it. |
01:46:30 | nimnoob123 | findIter cannot be called from nre, compiler says |
01:46:39 | flaviu | nimnoob123: Please post code. |
01:46:53 | nimnoob123 | sec |
01:47:22 | flaviu | Ok, so I can deprecate findAll() and replace it with findIterF(string, Regex, start = 0, endpos = -1, format = "$0"). |
01:47:29 | * | BitPuffin quit (Ping timeout: 252 seconds) |
01:47:49 | reactormonk | flaviu, ok, point taken. good old gluecode. |
01:48:22 | nimnoob123 | Can I delete private gists? |
01:48:28 | flaviu | That way it's possible to use a custom format string, as well being more consitant with findIter. I'm not sure I like the name, I'd appreciate it if someone came up with a better name. |
01:48:29 | * | davidter_ joined #nim |
01:48:42 | flaviu | nimnoob123: You can delete all gists. |
01:49:06 | flaviu | I'd encourage you not to, for the convenience of those coming from google. |
01:49:08 | nimnoob123 | https://gist.github.com/G4MR/8cc04c72d1de895ae189 |
01:49:28 | nimnoob123 | yeah I don't think I want this out there when I'm done |
01:50:09 | nimnoob123 | btw that works, just doesn't output what I want, pulls the full tag, I mean I can work with it, but it's just an incorrect output though |
01:50:39 | * | davidte__ joined #nim |
01:51:02 | flaviu | nimnoob123: I don't see any compiler errors. |
01:51:13 | nimnoob123 | last message |
01:51:23 | nimnoob123 | was a mistype which is why i got an error |
01:51:38 | * | davidterry quit (Ping timeout: 264 seconds) |
01:52:00 | nimnoob123 | but yeah still doesn't explain why it isn't capturing the group only |
01:52:43 | flaviu | nimnoob123: That's the way it's supposed to work. It's inadequately documented and not very good design either. |
01:52:51 | nimnoob123 | expected output is what ever is in between: content="" |
01:52:55 | randomwalk | flaviu: Thanks for the nre lib. I'm gonna try it. |
01:53:16 | nimnoob123 | so how do I get the expected result im looking for |
01:53:28 | flaviu | nimnoob123: I'll add findIterf(string, Regex, start = 0, endpos = -1, format = "$0") as soon as I can find a name that doesn't suck :) |
01:53:56 | * | davidter_ quit (Ping timeout: 256 seconds) |
01:54:58 | nimnoob123 | findIterFmt maybe? not sure |
01:55:01 | * | davidte__ quit (Ping timeout: 250 seconds) |
01:55:02 | * | davidterry joined #nim |
01:55:30 | randomwalk | flaviu: thx, i'll use PCRE a lot. I remember when perl was the only option. :) |
01:55:45 | nimnoob123 | it describes what it does pretty well I'd say flaviu |
01:55:49 | * | davidter_ joined #nim |
01:57:29 | * | davidterry quit (Read error: Connection reset by peer) |
01:57:46 | nimnoob123 | yeah idk lol |
01:58:10 | flaviu | randomwalk: Nim's re uses pcre too, but thanks! nimnoob123: That's better, I'll probably use that. |
01:58:18 | * | davidterry joined #nim |
01:59:24 | flaviu | Anyway, I've got to get to be right now, so use var myseq: seq[string] = @[]; for match in findIter(...): myseq.add(match.captures[0]) |
01:59:34 | * | davidterry quit (Remote host closed the connection) |
01:59:40 | flaviu | you may want to import optional_t.nonstrict |
02:00:24 | nimnoob123 | alright let me try it |
02:01:14 | * | davidter_ quit (Ping timeout: 264 seconds) |
02:01:43 | def- | flaviu: for me it was just "import optional_t" btw |
02:01:56 | def- | nonstrict didn't work strangely |
02:01:57 | * | Jehan_ quit (Quit: Leaving) |
02:02:22 | nimnoob123 | perfect |
02:02:36 | nimnoob123 | thanks flaviu |
02:03:01 | nimnoob123 | you should document that for the time being imo |
02:03:59 | flaviu | def-: make an issue with an example on the optional_t repo, and I'll look into it tomorrow. nimnoob123: yep, tomorrow. |
02:05:23 | * | reem quit (Remote host closed the connection) |
02:07:50 | * | reem joined #nim |
02:08:42 | * | saml_ joined #nim |
02:09:52 | * | darkf joined #nim |
02:11:50 | * | reem quit (Remote host closed the connection) |
02:15:45 | def- | flaviu: seems to work now. maybe i just had an old version of something |
02:16:18 | Maxdamantus | Araq: I cleaned some of that stuff up btw and added it to the branch in the PR (and rebased it), in case that's not something GH emails about. |
02:17:58 | * | gsingh93 joined #nim |
02:24:07 | * | reem joined #nim |
02:28:38 | OderWat | @Araq: keineschweine.nim :-P |
02:46:50 | randomwalk | nimnoob123: I'm trying to use nre...after I do a match, I try to look at the capture with m.captures[0], but I get this error: Error: type mismatch: got (Option[RegexMatch]) |
02:47:22 | nimnoob123 | yeah i used to get that issue, what i did was the iter trick flaviu showed me, sec i'll get you a snippet |
02:48:00 | def- | randomwalk: import optional_t.nonstrict |
02:48:22 | nimnoob123 | https://gist.github.com/G4MR/8bec3d4c21c1ca0f4728 try |
02:48:36 | nimnoob123 | err obviously with your own variables |
02:48:54 | * | reem quit (Remote host closed the connection) |
02:49:16 | nimnoob123 | trying to do it manually is weird, i'll just wait til tomorrow when flaviu put up some more examples with the other methods. for now that works for me |
02:49:27 | nimnoob123 | procs* |
02:49:32 | randomwalk | that makes gcc fail to compile pcre on windows :( |
02:49:45 | def- | randomwalk: just delete the nimcache directory, known bug |
02:50:01 | nimnoob123 | yeah had to do that too earlier, forgot about that |
02:50:01 | randomwalk | what does nonstrict do? |
02:50:08 | def- | randomwalk: not the slightest idea |
02:50:20 | nimnoob123 | it was supposed to include a None/Some type iirc |
02:50:55 | nimnoob123 | i only include the optional_t |
02:51:08 | flaviu | I should be sleeping, but https://github.com/flaviut/optional_t/blob/master/src/optional_t/nonstrict.nim |
02:51:12 | nimnoob123 | which actually compiles (and im not sure if I even need that) |
02:51:45 | flaviu | basically makes Option work like refs, where you can derefrence nil, you'll just get an error. |
02:51:54 | nimnoob123 | ic |
02:52:44 | * | reem joined #nim |
02:52:47 | Maxdamantus | I think a decent interface for optionals that works in most languages is iteration. |
02:53:31 | Maxdamantus | for a in Just 5: for b in Just 4: echo (a + b) |
02:54:02 | flaviu | Maxdamantus: optional_t has map, but that's a good idea. |
02:54:11 | Maxdamantus | Particularly because optionals are just a special case of arrays/lists. |
02:54:18 | Maxdamantus | ie, 1- or 0-element lists. |
02:56:06 | * | chemist69_ joined #nim |
02:59:13 | * | chemist69 quit (Ping timeout: 255 seconds) |
02:59:57 | randomwalk | flaviu: Why is the return type of match Option[RegexMatch] instead of just RegexMatch? |
03:00:52 | flaviu | What if it fails to match? |
03:01:02 | * | reem quit (Remote host closed the connection) |
03:01:10 | randomwalk | nil |
03:01:58 | * | reem joined #nim |
03:02:01 | flaviu | But RegexMatch isn't a ref :) |
03:02:21 | randomwalk | What do I check? |
03:02:39 | flaviu | https://github.com/flaviut/nre/blob/master/src/nre.nim#L21 |
03:03:25 | flaviu | Not making it a ref provides performance improvements, heap allocation and cleanup is fairly slow. |
03:04:17 | * | reem quit (Remote host closed the connection) |
03:04:56 | * | darkf quit (Read error: Connection reset by peer) |
03:05:20 | * | darkf joined #nim |
03:05:37 | randomwalk | flaviu: ok, so maybe the optimization is making it hard for me to read the docs. How do I check if my match succeeds, then grab the captures? |
03:08:07 | flaviu | nre depends on https://github.com/flaviut/optional_t, which provides the Option type. You can do myOption.isSome() or if myOption: to check for match success, and nonstrict automatically retrieves the value inside the Option, or you can use myOption.get. |
03:08:35 | flaviu | You then have access to everything described here: https://github.com/flaviut/nre#optionregexmatch |
03:09:08 | flaviu | btw, all these questions are helpful for me. They tell me which parts of the documentation are unclear. |
03:09:51 | randomwalk | ok, thx. yes for nim noobs it just seems like you're talking about internals |
03:12:19 | flaviu | randomwalk: I'm not sure I understand what you said. |
03:14:22 | * | davidterry joined #nim |
03:15:27 | * | davidterry quit (Remote host closed the connection) |
03:18:17 | flaviu | I'm not really talking about language internals, and IMO whether RegexMatch is a ref or not is an implementation detail. |
03:21:02 | * | aidanh quit (Ping timeout: 264 seconds) |
03:22:15 | randomwalk | flaviu: i've only been writing nim for 2 days |
03:22:25 | * | aidanh joined #nim |
03:23:58 | flaviu | Ah, I see. |
03:27:24 | * | reem joined #nim |
03:31:41 | * | reem quit (Remote host closed the connection) |
03:39:59 | * | davidterry joined #nim |
03:47:10 | * | jholland quit (Quit: Connection closed for inactivity) |
03:47:16 | * | davidterry quit (Ping timeout: 256 seconds) |
03:49:49 | * | davidterry joined #nim |
03:51:41 | * | davidter_ joined #nim |
03:52:16 | randomwalk | flaviu: Why on failure is it None[RegexMatch] not Option[None]? The notation is confusing. |
03:53:43 | * | davidter_ quit (Remote host closed the connection) |
03:54:31 | * | davidter_ joined #nim |
03:55:08 | * | davidterry quit (Ping timeout: 246 seconds) |
03:55:22 | * | randomwalk is reading the optional_t docs ... |
03:56:15 | * | reem joined #nim |
03:56:43 | * | davidterry joined #nim |
03:58:16 | * | davidterry quit (Remote host closed the connection) |
03:59:03 | * | davidterry joined #nim |
03:59:44 | * | davidter_ quit (Ping timeout: 246 seconds) |
04:00:35 | * | davidterry quit (Remote host closed the connection) |
04:01:40 | * | davidterry joined #nim |
04:02:46 | * | reem quit (Remote host closed the connection) |
04:02:55 | * | davidterry quit (Remote host closed the connection) |
04:03:48 | randomwalk | When I try to stringify the return type of type() I get: Error: internal error: GetUniqueType |
04:04:03 | * | davidterry joined #nim |
04:05:11 | def- | randomwalk: import typetraits and use name() |
04:05:16 | * | davidterry quit (Remote host closed the connection) |
04:05:58 | * | randomwalk thanks def-flavui-flav |
04:06:20 | * | davidterry joined #nim |
04:06:55 | * | reem joined #nim |
04:08:03 | * | davidter_ joined #nim |
04:09:48 | * | davidte__ joined #nim |
04:10:56 | * | davidt___ joined #nim |
04:11:29 | * | davidterry quit (Ping timeout: 245 seconds) |
04:12:20 | * | davidter_ quit (Ping timeout: 246 seconds) |
04:12:23 | randomwalk | Does name() capture exceptions? echo(name(type(m.captures[0]))) prints "string", but m.captures[0] generates Error: unhandled exception: Cannot fetch value from a None [FieldError] |
04:13:04 | * | davidterry joined #nim |
04:14:24 | * | davidte__ quit (Ping timeout: 245 seconds) |
04:14:37 | * | davidterry quit (Remote host closed the connection) |
04:15:35 | * | davidterry joined #nim |
04:15:46 | randomwalk | I'll just use split() for now...maybe I'll refactor to regex later... |
04:16:50 | * | davidt___ quit (Ping timeout: 264 seconds) |
04:17:25 | * | davidter_ joined #nim |
04:19:16 | * | davidte__ joined #nim |
04:20:16 | * | davidt___ joined #nim |
04:21:07 | * | davidterry quit (Ping timeout: 255 seconds) |
04:21:24 | fowl | randomwalk, the error says that m is None, you need to check m before trying to use its value |
04:21:37 | * | davidt___ quit (Remote host closed the connection) |
04:22:11 | * | davidter_ quit (Read error: Connection reset by peer) |
04:22:46 | * | davidterry joined #nim |
04:23:03 | randomwalk | fowl: example? |
04:23:49 | * | davidte__ quit (Ping timeout: 264 seconds) |
04:24:57 | * | davidter_ joined #nim |
04:26:23 | * | reem quit (Remote host closed the connection) |
04:27:13 | * | davidte__ joined #nim |
04:27:58 | fowl | randomwalk, you can check with if m: |
04:28:14 | * | davidterry quit (Ping timeout: 252 seconds) |
04:28:46 | fowl | it collapses to a bool |
04:29:07 | fowl | when it has a value, its true, when it doesnt its false, its the isSome() function |
04:29:28 | randomwalk | fowl: Thx, I'll try that later. |
04:29:54 | * | davidterry joined #nim |
04:30:17 | * | davidter_ quit (Ping timeout: 245 seconds) |
04:31:15 | * | davidterry quit (Remote host closed the connection) |
04:31:45 | * | davidterry joined #nim |
04:32:44 | * | davidte__ quit (Ping timeout: 245 seconds) |
04:33:11 | * | davidter_ joined #nim |
04:33:35 | * | davidter_ quit (Remote host closed the connection) |
04:34:14 | * | davidterry quit (Read error: Connection reset by peer) |
04:34:41 | * | davidterry joined #nim |
04:37:39 | * | reem joined #nim |
04:40:20 | * | davidterry quit (Ping timeout: 246 seconds) |
04:42:45 | randomwalk | are there builtin equivalents of atoi and atof? I'm using the c functions currently. |
04:43:04 | getoffmalawn | randomwalk: strutils.parseInt and parseFloat, I think? |
04:43:45 | getoffmalawn | ... ignore me, I gave you the opposite |
04:44:11 | randomwalk | no that looks right |
04:44:33 | getoffmalawn | Haha! Sorry. I haven't used C for a long time, got the direction of atoi and atof confused. |
04:44:45 | def- | the other way around is just a $ |
04:45:28 | randomwalk | it worked :) |
04:51:07 | * | davidterry joined #nim |
04:52:40 | randomwalk | When I declare a var with a name already in the namespace, does the collision always just result in a silent local shadowing (occlusion)? |
04:52:48 | * | davidterry quit (Remote host closed the connection) |
04:53:39 | nimnoob123 | hmm nre doesn't like really long stringfs |
04:53:43 | * | davidterry joined #nim |
04:53:45 | nimnoob123 | strings* |
04:54:35 | nimnoob123 | like 662897 character length strings |
04:55:09 | * | davidterry quit (Remote host closed the connection) |
04:55:14 | * | ChrisMAN quit (Ping timeout: 245 seconds) |
04:55:52 | * | davidterry joined #nim |
04:58:12 | * | davidterry quit (Read error: Connection reset by peer) |
04:58:54 | * | davidterry joined #nim |
04:59:08 | * | saml_ quit (Quit: Leaving) |
05:00:10 | * | davidterry quit (Remote host closed the connection) |
05:00:32 | * | TEttinger joined #nim |
05:00:41 | * | davidterry joined #nim |
05:02:47 | * | davidter_ joined #nim |
05:02:56 | * | davidter_ quit (Read error: Connection reset by peer) |
05:03:12 | * | davidterry quit (Read error: Connection reset by peer) |
05:03:18 | * | davidter_ joined #nim |
05:07:55 | * | davidter_ quit (Ping timeout: 255 seconds) |
05:20:23 | * | akiradeveloper joined #nim |
05:21:45 | akiradeveloper | I am trying to use asyncnet but it doesn't work as I expect https://gist.github.com/akiradeveloper/06a3e38e0839989342ba I think server should fetch 4 byte but is 0 byte actually. What's wrong with my code? |
05:28:56 | * | a5i quit (Quit: Connection closed for inactivity) |
05:30:41 | * | aidanh quit (Ping timeout: 246 seconds) |
05:32:50 | * | aidanh joined #nim |
05:38:45 | randomwalk | When I create a table type, do I need to write my own add() implementation? |
05:38:46 | randomwalk | var ot = initOrderedTable[string, float32](initialSize = 256) |
05:38:46 | randomwalk | #... |
05:38:46 | randomwalk | ot.add(key: s, val: f) # compiler Error: type mismatch: got (OrderedTable[string, float32]) |
05:41:35 | nimnoob123 | just do |
05:41:44 | nimnoob123 | ot.add("key", floatval) |
05:43:13 | * | akky joined #nim |
05:47:26 | * | akky quit (Remote host closed the connection) |
05:47:59 | fowl | ot[key] = value |
05:58:48 | * | fizzbooze quit (Ping timeout: 252 seconds) |
06:09:52 | * | aidanh quit (Ping timeout: 240 seconds) |
06:14:29 | * | aidanh joined #nim |
06:20:02 | * | bavers joined #nim |
06:20:09 | * | bavers left #nim ("Quit") |
06:20:11 | randomwalk | fowl: thx, i got my program working. it grabs yahoo finance data, and very quickly thx to nim :) |
06:20:53 | * | kashyap_ joined #nim |
06:22:07 | * | gsingh93 quit (Ping timeout: 256 seconds) |
06:23:03 | * | reem quit (Remote host closed the connection) |
06:34:52 | fowl | randomwalk, cool :) |
06:36:18 | * | bjz joined #nim |
06:40:48 | * | akiradeveloper quit (Quit: Page closed) |
06:43:05 | * | bjz quit (Ping timeout: 256 seconds) |
06:46:03 | * | reem joined #nim |
06:52:22 | * | allan0_ quit (Ping timeout: 245 seconds) |
06:54:18 | * | reem quit (Remote host closed the connection) |
07:07:20 | * | elbow_jason joined #nim |
07:07:47 | * | allan0_ joined #nim |
07:16:41 | randomwalk | ref-: I have a seq[string] that I want to reduce by concatenating all the strings together; is there a standard idiom for map reduce in nim? |
07:17:39 | randomwalk | ref- is asleep/gone. |
07:17:53 | randomwalk | oh i meant def- :) |
07:18:45 | elbow_jason | def-: ^ |
07:19:00 | elbow_jason | you have to name him to summon him. |
07:23:34 | * | reem joined #nim |
07:24:43 | * | davidterry joined #nim |
07:25:22 | randomwalk | No prob. I got my own ugly code. I'll try to refactor later. :) |
07:25:57 | * | reem quit (Remote host closed the connection) |
07:26:49 | Maxdamantus | .eval join(@["foo", "bar". "baz"]) |
07:26:53 | Mimbus | Maxdamantus: eval.nim(3, 26) Error: identifier expected, but found 'baz' |
07:27:02 | Maxdamantus | .eval join(@["foo", "bar", "baz"]) |
07:27:05 | Mimbus | Maxdamantus: eval.nim(3, 4) Error: value of type 'string' has to be discarded |
07:27:28 | Maxdamantus | er |
07:27:33 | Maxdamantus | .eval echo join(@["foo", "bar", "baz"]) |
07:27:37 | Mimbus | Maxdamantus: foobarbaz |
07:29:54 | cazov | sequtils has foldl, like foldl(words, a&b) |
07:30:29 | * | bjz joined #nim |
07:37:30 | randomwalk | cazov: thx fold works |
07:38:40 | cazov | the join max said is a little cleaner though. the bot syntax made it look more complicated to me haha |
07:40:58 | * | reem joined #nim |
07:43:13 | randomwalk | cazov: ya that worked too. :) |
07:44:46 | randomwalk | In my code I pass a Table to a function. Does it copy the whole thing by value, or does it pass a reference? Do I need to use a TableRef to optimize it? |
07:44:56 | randomwalk | err proc i mean |
07:46:01 | * | reem quit (Remote host closed the connection) |
07:50:49 | randomwalk | What is a good example use of TableRef? |
07:52:22 | * | reem joined #nim |
07:55:52 | * | reem quit (Remote host closed the connection) |
07:56:56 | * | leonlee joined #nim |
07:57:58 | randomwalk | I mean, my proc returns a table....same question for when putting a table in another table: is it deep copied unless I pass a ref? |
08:02:16 | * | getoffmalawn quit (Quit: WeeChat 1.0) |
08:04:21 | fowl | yes it is deep copied randomwalk |
08:05:49 | fowl | it is passed by reference also, you dont need to worry about that |
08:06:12 | randomwalk | fowl: which? :) |
08:06:15 | fowl | there are byRef/byCopy pragmas you can use to control that for object types |
08:07:09 | randomwalk | so when would I refer to a TableRef, only in a pragma? |
08:07:14 | fowl | randomwalk, well table[k,v] consists of a few seqs, seqs have value semantics (even though underlying they are refs) |
08:07:39 | * | reem joined #nim |
08:09:00 | fowl | no you would use either TableRef or Table, use TableRef if you need to pass it around by reference, the table is shared by multiple objects |
08:09:27 | fowl | or if the table is shared .. ^ |
08:09:47 | randomwalk | ok |
08:10:57 | * | reem quit (Remote host closed the connection) |
08:14:41 | * | Jehan_ joined #nim |
08:22:04 | * | reem joined #nim |
08:22:11 | * | randomwalk quit (Ping timeout: 246 seconds) |
08:24:31 | * | reem quit (Remote host closed the connection) |
08:25:37 | * | davidterry quit (Remote host closed the connection) |
08:26:19 | * | ruzu quit (Ping timeout: 250 seconds) |
08:36:26 | * | davidterry joined #nim |
08:37:47 | * | chemist69_ quit (Quit: WeeChat 1.1.1) |
08:38:00 | * | chemist69 joined #nim |
08:38:51 | * | davidterry quit (Remote host closed the connection) |
08:41:30 | * | davidterry joined #nim |
08:43:36 | * | reem joined #nim |
08:44:23 | * | ruzu joined #nim |
08:45:54 | * | davidterry quit (Ping timeout: 256 seconds) |
08:46:15 | * | reem quit (Remote host closed the connection) |
08:48:02 | * | reem joined #nim |
08:49:27 | * | Trustable joined #nim |
08:49:50 | * | reem quit (Remote host closed the connection) |
08:58:17 | * | reem joined #nim |
09:03:52 | * | zahary joined #nim |
09:04:29 | * | reem quit (Remote host closed the connection) |
09:06:01 | * | tumult joined #nim |
09:12:19 | * | reem joined #nim |
09:13:10 | * | d3m1gd joined #nim |
09:13:40 | * | epichero quit () |
09:14:47 | * | epichero joined #nim |
09:22:10 | * | reem quit (Remote host closed the connection) |
09:25:54 | * | reem joined #nim |
09:33:04 | * | reem quit (Remote host closed the connection) |
09:38:44 | * | reem joined #nim |
09:41:17 | * | gokr quit (Ping timeout: 250 seconds) |
09:42:09 | * | reem quit (Remote host closed the connection) |
09:43:16 | * | chemist69 quit (Quit: WeeChat 1.1.1) |
09:44:28 | * | gokr joined #nim |
10:03:17 | * | Jehan_ quit (Quit: Leaving) |
10:03:43 | * | chemist69 joined #nim |
10:10:14 | * | l_amee joined #nim |
10:11:45 | * | l_amee is now known as l04m33 |
10:18:58 | * | reem joined #nim |
10:19:48 | * | Trixar_za joined #nim |
10:20:35 | * | reem quit (Remote host closed the connection) |
10:27:48 | l04m33 | I wanted to handle exceptions raised by async procs, but my program here always gets SIGSEGV: https://gist.github.com/l04m33/617bf88e3c74a88bd59b |
10:27:55 | l04m33 | Am I doing anything wrong? |
10:30:36 | l04m33 | Peeked around the standard lib and found no usage example of `try: await p(); except: ...` |
10:31:07 | l04m33 | But seems that it's handled in asyncdispatch ? |
10:31:41 | fowl | i dont have experience with asyncdispatch |
10:33:28 | l04m33 | Me too, just peeking around and found that asyncdispatch mentioned `try: await p(); except: ...` syntax in the source code |
10:34:26 | l04m33 | s/too/either |
10:36:21 | l04m33 | https://github.com/Araq/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1223 |
10:38:32 | fowl | your usage looks right but idk |
10:40:08 | * | Maxdamantus quit (Ping timeout: 246 seconds) |
10:40:20 | * | Maxdamantus joined #nim |
10:42:24 | * | BlaXpirit joined #nim |
10:42:59 | * | reem joined #nim |
10:47:10 | l04m33 | fowl: thanks anyway ~ |
10:47:34 | fowl | l04m33, post on the forum or post an issue! |
10:48:29 | l04m33 | fowl: OK I'll try the forum then |
10:50:15 | * | epichero quit (Remote host closed the connection) |
10:52:49 | * | Tennis joined #nim |
10:52:49 | * | Tennis quit (Changing host) |
10:52:49 | * | Tennis joined #nim |
10:54:30 | * | reem quit (Remote host closed the connection) |
11:39:35 | * | davidterry joined #nim |
11:44:10 | * | davidterry quit (Ping timeout: 265 seconds) |
11:48:05 | * | zahary quit (Ping timeout: 252 seconds) |
11:51:06 | * | epichero joined #nim |
11:51:57 | * | reem joined #nim |
11:54:59 | * | reem quit (Remote host closed the connection) |
11:55:53 | * | epichero quit (Ping timeout: 256 seconds) |
12:02:27 | * | reem joined #nim |
12:03:40 | def- | flaviu: any idea about "could not import: pcre_stack_guard"? https://github.com/kanaka/mal/pull/20#issuecomment-77097742 |
12:03:48 | * | reem quit (Remote host closed the connection) |
12:04:13 | * | zahary joined #nim |
12:04:15 | def- | Oh right, I guess I know why |
12:08:42 | gokr | Araq: That async snippet fails for me on 0.10.3 too. |
12:13:59 | * | johnsoft quit (Ping timeout: 245 seconds) |
12:14:05 | * | TEttinger quit (Quit: Leaving) |
12:14:54 | * | johnsoft joined #nim |
12:18:26 | * | reem joined #nim |
12:19:22 | * | reem quit (Remote host closed the connection) |
12:23:40 | * | reem joined #nim |
12:25:43 | * | reem quit (Remote host closed the connection) |
12:26:50 | OderWat | Check your C knowledge http://kukuruku.co/hub/programming/i-do-not-know-c ... I failed multiple times to give the right answer :( |
12:43:21 | * | pafmaf joined #nim |
12:44:49 | * | Jehan_ joined #nim |
13:07:50 | * | a5i joined #nim |
13:08:31 | novist | wow, c is backwards.. |
13:08:49 | * | pafmaf quit (Ping timeout: 264 seconds) |
13:15:03 | * | BitPuffin joined #nim |
13:18:43 | * | pafmaf joined #nim |
13:18:52 | * | kashyap_ quit (Ping timeout: 246 seconds) |
13:23:13 | * | pafmaf quit (Ping timeout: 264 seconds) |
13:23:46 | * | pafmaf joined #nim |
13:25:13 | Jehan_ | novist: In what way? |
13:25:35 | novist | unexpected things happening |
13:26:34 | Jehan_ | Well, that's sort of par for the course for what's essentially a portable assembly language. :) |
13:28:05 | * | johnsoft quit (Ping timeout: 246 seconds) |
13:28:28 | * | johnsoft joined #nim |
13:33:22 | * | NimBot joined #nim |
13:38:49 | * | pafmaf quit (Ping timeout: 264 seconds) |
13:40:07 | * | pafmaf joined #nim |
13:50:34 | * | reem joined #nim |
13:55:21 | * | jasondotstar quit (Quit: Leaving) |
13:55:53 | * | reem quit (Remote host closed the connection) |
14:04:31 | * | pafmaf quit (Quit: This computer has gone to sleep) |
14:14:26 | * | leonlee quit (Ping timeout: 264 seconds) |
14:16:59 | * | joelmo joined #nim |
14:17:08 | * | joelmo left #nim (#nim) |
14:17:17 | * | davidterry joined #nim |
14:20:29 | BlaXpirit | .eval echo uint(-1) # Is this guaranteed? |
14:20:32 | Mimbus | BlaXpirit: 18446744073709551615 |
14:21:54 | * | davidterry quit (Ping timeout: 245 seconds) |
14:22:15 | dv- | no |
14:22:26 | dv- | .eval echo uint64(-1) |
14:22:29 | Mimbus | dv-: 18446744073709551615 |
14:22:33 | dv- | but that is |
14:22:38 | * | reem joined #nim |
14:24:19 | * | reem quit (Remote host closed the connection) |
14:24:41 | BlaXpirit | well yeah, obviously |
14:24:49 | BlaXpirit | but this is undefined behavior in C |
14:25:34 | BlaXpirit | oh, nim evaluated this beforehand. bad example then. |
14:26:17 | BlaXpirit | .eval let a = -1; echo uint64(a) # Is this guaranteed? |
14:26:20 | Mimbus | BlaXpirit: 18446744073709551615 |
14:29:30 | BlaXpirit | "pretty much any system you’ll encounter these days uses two’s complement arithmetic" |
14:39:21 | nimnoob123 | lets say my main file has a simple object, but i split my code off into 2 files (but both files need to use the same object) is there a way to basically forward declare a type in nim? what's a good approach to that? |
14:40:14 | * | randomwalk joined #nim |
14:48:11 | BlaXpirit | nope, cant do that |
14:49:04 | def- | nimnoob123: you can add a "types.nim" file and import that from both files |
14:49:46 | nimnoob123 | i think the official httpclient does a when declared check thingy, could that work to temporarily create a nill object of the same type? |
14:50:01 | def- | no |
14:50:04 | nimnoob123 | nil* |
14:51:17 | def- | BlaXpirit: unsigned ints are guaranteed to wrap around, signed ints can do whatever they want in C |
14:51:24 | nimnoob123 | it just feels pointless creating a 2-5 line file and importing it |
14:57:02 | * | randomwalk quit (Ping timeout: 246 seconds) |
14:57:58 | def- | OderWat: i think it's finished: https://github.com/kanaka/mal#nim-0103 |
15:04:28 | * | epichero joined #nim |
15:08:56 | * | jholland joined #nim |
15:18:20 | * | mal`` quit (Ping timeout: 252 seconds) |
15:24:56 | * | BlaXpirit quit (Quit: Quit Konversation) |
15:27:28 | * | mal`` joined #nim |
15:36:18 | * | aidanh quit (Ping timeout: 244 seconds) |
15:37:52 | * | aidanh joined #nim |
15:38:53 | * | gmpreussner|lapt joined #nim |
15:40:11 | * | darkf quit (Quit: Leaving) |
15:52:07 | * | aidanh quit (Ping timeout: 265 seconds) |
15:54:56 | * | aidanh joined #nim |
15:56:30 | * | brson joined #nim |
16:04:26 | * | ChrisMAN joined #nim |
16:06:19 | * | davidterry joined #nim |
16:09:07 | * | dhasenan quit (Remote host closed the connection) |
16:10:46 | * | davidterry quit (Ping timeout: 252 seconds) |
16:13:30 | * | Boscop_ joined #nim |
16:14:44 | * | gmpreussner|lapt quit (Ping timeout: 272 seconds) |
16:15:25 | * | aidanh quit (Ping timeout: 256 seconds) |
16:16:58 | * | Boscop quit (Ping timeout: 256 seconds) |
16:19:21 | * | mnemonikk joined #nim |
16:21:15 | * | aidanh joined #nim |
16:31:48 | def- | http://hookrace.net/blog/make-a-lisp-in-nim/ |
16:32:12 | nimnoob123 | hmm htmlparser's entityToUtf8 is weird, modified it to my needs https://gist.github.com/G4MR/42d52305fabc0c5619ec |
16:32:30 | OderWat | @def- very very cool! |
16:33:31 | OderWat | I think that also answers the question why I pointed out this project to you @def- |
16:35:01 | * | nimnoob123 quit (Quit: Page closed) |
16:35:38 | gokr | def-: Cool stuff! |
16:35:53 | def- | A bit more complicated than the brainfuck interpreter |
16:36:02 | gokr | Btw, I |
16:37:28 | gokr | fowl showed me his glossolalia today, that's also slick stuff., |
16:37:28 | gokr | Much like PetitParser, but more nimish, so I am dropping that port off my list :) |
16:37:52 | OderWat | What about getting stuff like this to the frontpage of Nim? Like "Project of the Week / Month" with a backlog archive? |
16:38:13 | def- | gokr: that looks cool |
16:54:23 | * | wb_ joined #nim |
16:57:22 | * | wb quit (Ping timeout: 240 seconds) |
16:58:46 | def- | OderWat: a "Planet Nim" would be nice as a start in that direction, I think |
16:59:57 | def- | OderWat: Or someone starts making something like "This week in Rust/D/..." |
17:02:34 | OderWat | Or .. we put it on as "featured" on the website and are done for the next few weeks :) |
17:05:13 | * | phira quit (Excess Flood) |
17:05:43 | * | phira joined #nim |
17:05:46 | * | aidanh quit (Ping timeout: 252 seconds) |
17:07:09 | * | aidanh joined #nim |
17:12:25 | gokr | OderWat: Yeah, I will set up the planet, I dropped that ball a bit |
17:12:48 | gokr | I am also making a list of urls to articles - that I think we can maintain somewhere. |
17:16:50 | * | aidanh quit (Ping timeout: 264 seconds) |
17:18:58 | * | aidanh joined #nim |
17:21:46 | * | tumult quit (Ping timeout: 246 seconds) |
17:55:05 | * | davidterry joined #nim |
18:00:02 | * | davidterry quit (Ping timeout: 252 seconds) |
18:20:13 | * | nande joined #nim |
18:23:33 | * | fizzbooze joined #nim |
18:24:19 | * | aidanh quit (Ping timeout: 250 seconds) |
18:27:35 | * | aidanh joined #nim |
18:31:03 | * | johnsoft quit (Ping timeout: 252 seconds) |
18:32:23 | * | johnsoft joined #nim |
18:36:22 | * | aidanh quit (Ping timeout: 240 seconds) |
18:36:46 | * | gsingh93 joined #nim |
18:46:29 | * | kasprosian joined #nim |
18:46:43 | kasprosian | where can I find examples of nim source code on github? |
18:48:00 | def- | kasprosian: https://github.com/trending?l=nimrod |
18:49:09 | kasprosian | i'm a little surprised by the beauty of nim |
18:49:12 | kasprosian | tbh |
18:49:30 | kasprosian | question: has anybody had experience using a REPL with nimlang? |
18:49:54 | gokr | kasprosian: There is one buts a bit broken. But there are plans to renew it. |
18:50:19 | kasprosian | what exactly are those plans? |
18:50:20 | gokr | "buts"? I need coffee. |
18:50:32 | * | Menche quit (Ping timeout: 272 seconds) |
18:50:38 | def- | kasprosian: https://github.com/Araq/Nim/wiki/GSoC-2015-Ideas#create-a-new-repl-for-nim-using-tinycc |
18:50:49 | def- | without the gsoc part now since we were not accepted |
18:51:16 | gokr | Well, rest assured 3DICC wants this :) |
18:51:44 | def- | gokr: me too, i'm a bit worried it would not have ideal performance |
18:51:46 | * | aidanh joined #nim |
18:51:53 | def- | would probably have to hack into tinyCC at some point |
18:52:34 | kasprosian | any nim clones of nodejs? |
18:52:43 | gokr | I would also say that... dynamic reloading (using regular compiler) is similar. |
18:52:49 | gokr | And that we want. |
18:53:45 | def- | kasprosian: no clones, but you can look at jester and the async* stuff in the standard library for networking |
18:54:20 | kasprosian | nodejs's main idea is event-driven programming. I suppose that wouldn't be too hard in num, right? |
18:54:31 | * | Matthias247 joined #nim |
18:57:16 | def- | So I asked about why were rejected for GSoC but not much to improve in here: https://gist.github.com/def-/cb01b21094e34ece4c30 |
18:57:50 | * | fizzbooze quit (Ping timeout: 246 seconds) |
18:57:54 | * | Menche joined #nim |
18:58:28 | gokr | def-: Yeah. AFAICT, from the list of accepted - only relatively large language projects got in. |
18:59:38 | def- | gokr: If I had known that they'd only accept 137 projects this year I don't know if the application would've been worth it |
18:59:54 | def- | organizations* |
18:59:56 | gokr | def-: Agreed. How many was it last year? |
19:01:26 | def- | 190 |
19:01:41 | def- | Increasing every year |
19:01:45 | def- | So I assumed ~200 this year |
19:03:23 | onionhammer | i dont think the REPL needs ideal performance |
19:03:46 | onionhammer | more just for rapid prototyping and experimenting, no? |
19:06:13 | kasprosian | I agree with onionhammer |
19:06:35 | kasprosian | the REPL is to optimize human time instead of machine time. |
19:06:53 | def- | I've used the scala repl and when you can see it taking 1 second to do 1+1 that's no fun |
19:07:18 | onionhammer | well, i dont think tinycc is that slow |
19:07:46 | def- | with the current approach the program inside your repl would grow and grow and the entire thing would have to be recompiled all the time |
19:07:55 | onionhammer | thats more about compilation speed probably def- |
19:08:15 | onionhammer | tcc advertises quick compilation speed, but slower runtime |
19:08:31 | onionhammer | scala has to compile/jit everything before it actually starts up |
19:09:44 | gokr | Pharo compiles, jits and runs "2+3" in... 0.04 seconds. :) |
19:10:15 | gokr | No, wait... |
19:10:41 | gokr | 0.04 ms I mean. |
19:11:04 | onionhammer | okay, im just saying thats probalby why scala is slow |
19:11:12 | onionhammer | nim wouldnt have that issue |
19:14:46 | * | kasprosian quit (Quit: Page closed) |
19:23:28 | onionhammer | def- I just did a 1+1 with tcc and it was 0.002s :P |
19:23:42 | onionhammer | it was actually a loop of 100 hello worlds |
19:26:57 | * | aidanh quit (Ping timeout: 256 seconds) |
19:28:39 | * | brson quit (Ping timeout: 265 seconds) |
19:40:08 | * | aidanh joined #nim |
19:44:24 | * | aidanh quit (Ping timeout: 245 seconds) |
19:46:06 | * | aidanh joined #nim |
19:47:48 | * | fizzbooze joined #nim |
19:52:58 | * | johnsoft quit (Ping timeout: 252 seconds) |
19:53:34 | * | johnsoft joined #nim |
20:07:22 | Jehan_ | def-: That's really a JVM/Scala thing. |
20:11:02 | Jehan_ | I can't think of pretty much any other JIT-based REPL that's so sluggish. |
20:11:09 | * | aidanh quit (Ping timeout: 256 seconds) |
20:13:38 | * | aidanh joined #nim |
20:21:32 | dom96 | def-: That's really disappointing to hear. |
20:23:59 | * | elbow_json joined #nim |
20:23:59 | * | elbow_jason quit (Read error: Connection reset by peer) |
20:28:55 | * | sampwing joined #nim |
20:36:59 | * | BlaXpirit joined #nim |
20:45:01 | * | fizzbooze quit (Ping timeout: 265 seconds) |
20:49:22 | reactormonk | def-, the 1+1 is only the first time usually, because it tends to load some stuff later |
20:50:45 | * | sampwing quit (Ping timeout: 252 seconds) |
20:54:38 | def- | reactormonk: the first one takes 10 seconds for me, from then on it's 1 second |
21:02:18 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
21:04:06 | * | BlaXpirit quit (Remote host closed the connection) |
21:06:00 | * | BlaXpirit joined #nim |
21:08:12 | * | fizzbooze joined #nim |
21:12:35 | * | aidanh quit (Ping timeout: 246 seconds) |
21:16:55 | * | sampwing joined #nim |
21:17:46 | * | aidanh joined #nim |
21:22:46 | * | d3m1gd quit (Quit: WeeChat 1.1.1) |
21:25:39 | * | rkj-b joined #nim |
21:34:05 | * | rkj-b quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0.1/20150122214805]) |
21:35:31 | gokr | Anyone played with fuzzers to find bugs? Wondering if we could use it to harden Nim |
21:40:47 | def- | gokr: I have some experience with it. You'll need to know what part you want to test and make a test that can run really fast (< 1 ms ideally) |
21:41:33 | gokr | Did you play with the American Fuzzy Lop? |
21:42:24 | def- | yes: http://felsin9.de/nnis/software/#fuzzing-open-source-software-(2014) |
21:42:31 | * | brson joined #nim |
21:43:05 | gokr | def-: Oh, wow :) |
21:46:57 | * | johnsoft quit (Ping timeout: 245 seconds) |
21:47:10 | * | johnsoft joined #nim |
22:06:00 | * | skroll3 is now known as skroll |
22:16:13 | * | reem joined #nim |
22:21:28 | * | fizzbooze quit (Ping timeout: 252 seconds) |
22:22:47 | * | sampwing quit (Ping timeout: 252 seconds) |
22:31:42 | OderWat | BTW I modified tcc to run on os x in jit mode and can run a lot of nim code with that. I just don't really understand why it can't find symbols like fputs or mmap. So I wrote replacement and stub functions for that. Using the same tcc on linux I can't get it to work because tcc does not like the inlcude files at all. Which I again don't understand as it bails on stuff like size_t even if I added that by hand. So all in all: yes it works for me to use tcc to |
22:31:42 | OderWat | directly run nim code on osx but it's very raw what I have so far. |
22:35:41 | OderWat | I basically call tcc with the stub and all files in nimcache. It is very fast and could easily made into a repl I guess.. my simple script for running nim code is: https://gist.github.com/oderwat/cef72aaab2ab6ea9a590 |
22:36:40 | OderWat | The "hard" part (if you wonder) is making it work on os x at all as tcc does not really like to run the nim generated c-sources because of missing symbols without the stubs. |
22:45:35 | * | fizzbooze joined #nim |
22:45:43 | * | reem quit (Remote host closed the connection) |
22:47:11 | * | sampwing joined #nim |
22:55:48 | keldaris | silly question: if I have a proc with the signature f(A: var cint) and call it using a cint a as f(a), it still passes a pointer as if I had called a f(A: ptr cint) with f(addr(a)), correct? |
22:57:05 | Jehan_ | OderWat: You may want to look at https://bitbucket.org/behrends/nimr (it's not using tcc, but that could be addressed). |
22:57:51 | Jehan_ | keldaris: Well, both compile to approximately the same code. |
22:58:33 | Jehan_ | However, proc foo(x: var T) is closer to foo(T& x) in C++ than to foo(T* x). |
22:59:10 | keldaris | good, foo(T& x) is what I'm trying to get |
23:02:16 | OderWat | @jehan_ I think thats something quite different as it compiles and runs the executable "just" from another (hidden) nimcache folder. The tcc thing I am into does not compile at all and loads all stuff dynamically (i call it nimjit atm). It even works with my own raw mysql experiments, loading mysqlclient and runs everything as "just in time" code. |
23:03:04 | Jehan_ | OderWat: Yeah, I know. I mean as a basis instead of a shell script. |
23:04:01 | * | reem joined #nim |
23:04:41 | def- | OderWat: there is also a tinycc included with nim as well as a basic nim wrapper: https://github.com/Araq/Nim/blob/devel/compiler/tccgen.nim |
23:05:04 | OderWat | @jehan_ Well yes. I actually planed to make that an nim compiler feature :) (-jit) but I am not sure how much time I want to invest. It really bugged me that the same stuff which runs on my os x machine does not work in ubuntu "out of the box". I had to modify tcc to support $ in symbol names. |
23:06:01 | OderWat | I saw that @def- but it didn't work as I tried it. I don't remember why actually. Have to recheck that. |
23:06:02 | Jehan_ | Huh. I hadn't realized Nim used $ in symbols? At least I've never seen it. |
23:06:48 | OderWat | Thats the problem. When I used tinycc to compile system.nim it was missing stuff like _fputs$UNIX2003 and I can't find that anywhere |
23:07:36 | def- | OderWat: I tried using it like this, I think it worked so far: https://github.com/def-/Nim/blob/tcc-repl/compiler/tccgen.nim#L89-L120 |
23:09:20 | OderWat | So I modified system.nim to use fprintf() instead (and a lot other stuff) :) but thats not really a solution. I thought: just create stub versions of those missing stuff and ran into the problem that tinycc jsut don't like $ in symbol names. Which I could fix after finding how that works. I may have spent some time "for nothing" as I think there must be a way to get it compiler fputs() but how ... :( |
23:10:50 | OderWat | was any of that on Darwin @def- ? |
23:13:17 | def- | OderWat: linux only |
23:15:10 | * | fizzbooze quit (Ping timeout: 256 seconds) |
23:15:16 | OderWat | See.. my problem was this: https://gist.github.com/oderwat/48bee2d617ea3ec4c432 |
23:15:17 | * | reem quit (Remote host closed the connection) |
23:16:23 | OderWat | I literally scanned my whole system to find anything containing this symbols but did not find anything! |
23:16:37 | def- | strange, i don't get any identifiers with a $ |
23:17:22 | * | jjgedney joined #nim |
23:17:38 | OderWat | If you search the net you find something about $UNIX2003 being some old versions of the libc which where there in the past. now apple seems not to include them anymore |
23:21:32 | OderWat | I replaced fputs with fprintf and (anonymous) mmap with (tadaa) malloc. That works to an extend. But as I said. This is so special I don't know if I want to spent more time with that. |
23:22:02 | * | reem joined #nim |
23:25:50 | * | OderWat quit (Read error: Connection reset by peer) |
23:25:52 | * | Jehan_ quit (Quit: Leaving) |
23:25:54 | * | Demos joined #nim |
23:25:56 | * | OderWat_ joined #nim |
23:29:48 | * | keldaris quit (Quit: Page closed) |
23:30:59 | * | sampwing quit (Ping timeout: 252 seconds) |
23:31:12 | OderWat_ | Haha.. kernel panic because I plugged in a yubi-key.. way to go apple :( |
23:31:26 | * | filwit joined #nim |
23:33:27 | * | untitaker quit (Ping timeout: 256 seconds) |
23:34:50 | * | reem quit (Remote host closed the connection) |
23:36:13 | * | BlaXpirit quit (Quit: Quit Konversation) |
23:38:42 | * | untitaker joined #nim |
23:41:08 | * | reem joined #nim |
23:43:45 | * | brson quit (Quit: leaving) |
23:49:59 | Varriount | filwit: I liked your forum post regarding Rust. I have the same feelings as well. |
23:50:40 | filwit | Varriount: good to hear |
23:53:11 | Maxdamantus | complimentary or complementary? |
23:53:24 | * | Maxdamantus suspects the latter. |
23:54:21 | filwit | you're probably right... i suck at spelling.. one sec |
23:54:34 | Varriount | I think its the latter as well. |
23:54:35 | * | Maxdamantus does too. |
23:54:56 | Varriount | filwit: Your post is very well written though. Very... eloquent. |
23:55:01 | * | Maxdamantus usually struggles to spell things like "existence" |
23:55:20 | filwit | Varriount: thanks again :) |
23:55:28 | filwit | Maxdamantus: thanks for the typo catch |
23:56:51 | * | Maxdamantus hopes someday security will be practical. |
23:57:10 | Maxdamantus | Related: https://www.youtube.com/watch?v=iSmkqocn0oQ |
23:59:15 | * | reem quit (Remote host closed the connection) |