2012 10 01

      • nesv joined the channel
      • raggi
        krakensden: in this case, it would avoid mostly duplicated code inside a branch: if end == -1 { set = append(set, bytes[start:]) } else { set = append(set, bytes[start:end]) }
      • LunixA380
        So, if you do j = 0 for i = j + 1; i < 12 { } this will be never true.
      • Because the first term is read only one time, at the initialization
      • krakensden
        pnielsen: hngggg
      • of course
      • pnielsen
        doomlord: it's very good, yes
      • smw
        krakensden, you are having issues with the for syntax? Which one? The x;y;z syntax?
      • pnielsen
        doomlord: if I have to summarize it in one word: "simplicity"
      • krakensden
        for some reason I conflated the 0th and 2nd fields
      • xhpt2 joined the channel
      • as someone who writes C++ all day
      • this is strange and terrifying
      • smw
        lol
      • pnielsen
        krakensden: yet wonderful at the same time
      • doomlord
        looks awesome on paper, but new things usually have teething problems
      • LunixA380
        hmmm ?
      • krakensden
        pnielsen: no, I like go- forgetting how to write a for loop identical to the C++ oen is terrifying ^_^
      • pnielsen
        doomlord: not really. Go is several years old now, and its stdlib/documentation are very mature for its age
      • doomlord
        does it back onto other tools like LLVM; what about debuggers etc.
      • pnielsen
        krakensden: ah 🙂
      • smw
        krakensden, lmao
      • doomlord
        oh actually being GC, does that mean its less suited to LLVM
      • smw
        krakensden, must be tired 😉
      • pnielsen
        doomlord: it has a very fast compiler suite, gc, and an optimized frontend for GCC
      • doomlord: some people are working on an LLVM frontend
      • doomlord: gdb is the debugger. The latest version has Go support
      • doomlord
        i'm looking for "another language"... i can only seriously use C++ at the minute
      • pnielsen
        doomlord: there's a good chance Go is that language. Check out the tour: http://tour.golang.org
      • tzee818_ joined the channel
      • doomlord
        are there opengl bindings 🙂
      • smw
        doomlord, the go tour is very well suited for C++ people
      • doomlord
        i loved the idea of haskell but straight away the loss of object.subscript freaks me out when reasoning about datastructures.. just a comfort thing
      • LunixA380
        Why a LLVM frontend?
      • doomlord
        not too keen on JVM. (scala otherwise looked good)
      • LunixA380
        For doing what?
      • smw
        LunixA380, many reasons
      • doomlord
        i like the idea of seperating the language from the back end
      • i would have more confidence in implementations
      • smw
        LunixA380, it would give Go a VM, perhaps eventually an interpreter
      • LunixA380
        Why Go will need a VM?
      • doomlord
        i perceived LLVM as for non-GC;
      • smw
        LunixA380, it does not necessarily need it. But VMs have benifits
      • being able to compile code to a cross platform VM is a good thing
      • doomlord
        i would have way more confidence in a sepearte backend for low level tweaks, eg porting to future cpus, keeping up with optimizations
      • LunixA380
        Can you say some of them?
      • doomlord
        LLVM isn't strictly a VM is it.. its an acronym that stuck. its a compiler back end.
      • smw
        LunixA380, same bytecode runs everywhere? That is what pNaCl is doing
      • using the llvm VM for running code in the browser
      • xhpt2
        Is it more or equally idiomatic to do "func NewMyType ( value SomeType ) *MyType" or "func NewMyType( value SomeType ) (*MyType, error)"? If there is an error while constructing is best to just return nil?
      • LunixA380
        Okay smw. Me I not like VM, but that's more a matter of taste
      • I don't*
      • smw
        LunixA380, but, it is yet another choice
      • LunixA380, this is a good thing 🙂
      • LunixA380, a VM would make an interpreter easier
      • LunixA380, interpreter leads to REPL 🙂
      • LunixA380
        ^^
      • smw
        LunixA380, you could probably also compile Go and C code together statically with a llvm frontend
      • LunixA380
        GCCGo wouldn't do already that with GIMPLE?
      • erming joined the channel
      • slicslak joined the channel
      • mreedell joined the channel
      • doomlord
        how practical is a go repl... not a deciding feature but would be interesting.
      • traviscline
        xhpt2: if an error is possible i'd say error value, that seems like it'd be a bit rare though
      • smw
        doomlord, yeah, I don't think I want a go repl
      • doomlord, but people keep asking for it
      • doomlord, repls for languages like Go are rarely useful
      • tzee818 joined the channel
      • doomlord
        repl for python etc.. great
      • smw
        doomlord, of course!
      • doomlord
        repl for C++ however...
      • smw
        doomlord, my thoughts exactly
      • LunixA380
        smw<- REPL is good for answering stupid questions that searching in docs will take too long
      • pnielsen
        doomlord: gdb for inspection works well, given the builtin Go support
      • LunixA380
        Or you can't understand by simply reading these docs
      • pnielsen doesn't buy that you need a REPL
      • pnielsen
        people have been programming in compiled languages without REPLs for ages without trouble
      • doomlord
        REPL makes learning syntax intuitive. plus its hugely nostalgic. 8bit BASIC
      • pnielsen
        and I'm a Lisp/Haskell programmer
      • it's not that REPLs aren't useful, it's that after the compile-time checking, there are few things you need to work with interactively that you can't just inspect or prod by editing and rerunning
      • Spaceghostc2c
        I'm a sober person. 🙁
      • This is not good.
      • LunixA380
        pnielsen<- You haven't trouble, but you've to create an project for answering your question
      • pnielsen
        compilation times in Go are extremely short
      • LunixA380
        Yes, it does
      • smw
        LunixA380, what types of questions?
      • LunixA380
        Questions like : If I type [0:3], what I'll get?
      • pnielsen
        LunixA380: that is a question of understanding the language
      • if you want to know these things, you should read the specification
      • LunixA380
        Sure, we can use the go tour/playgolang tool for testing things like that
      • pnielsen
        it is very readable
      • xhpt2
        traviscline: would you do input validation in the constructor? For example, let's say I have "type country string" and a constructor that makes sure that the value is an actual country. If the value being set isn't a country would you just return nil?
      • LunixA380
        pnielsen<- It is readable but sometimes, practice helps more than reading
      • pnielsen
        LunixA380: I don't disagree about a REPL to play in
      • kazupon joined the channel
      • LunixA380: I disagree about a REPL to inspect objects in running, large programs
      • and otherwise evaling code at runtime
      • LunixA380
        +1 for you so pnielsen
      • pnielsen
        Play is very nice for a play-repl, or 'go run'
      • LunixA380
        I use it only to test little piece of code
      • pnielsen
        yeah, that's fine
      • doomlord
        i like the idea of backends like LLVM, JVM etc.. then you basically pick the language "front-end" and "back end" seperately from some existing combinations
      • senior75151 joined the channel
      • LunixA380
        And I read, as recommended, all the specification. But I forgot a lot of things about it, when I learned some (iota for example)
      • pnielsen
        doomlord: LLVM is quite fascinating
      • doomlord
        prolification of languages with common optimized backends .. and pick the front-end that suits your preferences
      • pnielsen
        doomlord: gc, however, compiles tens of times faster. It really makes a huge difference for large projects
      • doomlord: compilation time is 0.1-3 seconds, not 1 minute-3 hours
      • doomlord
        is there compile-time/ optimization tradeoff
      • davecheney joined the channel
      • pnielsen
        doomlord: yes. gccgo (the GCC frontend) is more optimized
      • -O2, etc
      • theplanet joined the channel
      • doomlord
        i can see a definite value to a less-optimized, fast build
      • pnielsen
        gc go still beats most languages, though
      • LunixA380
        An optimized compiler is one that can write optimized code fastly
      • I think gc is nice in this category
      • doomlord
        optimized optimizing compiler..
      • pnielsen
        inception
      • LunixA380
        doomlord<- This'll get more weird when the Go compiler gets written in Go
      • oskarth1 joined the channel
      • doomlord
        the whole bootstrapping thinh
      • lyaunzbe joined the channel
      • Cyan6 joined the channel
      • on another channel the mix of opinions has started.. rust vs go ?
      • raggi
        go == simple, rust == complicated
      • pnielsen
        doomlord: take a look and decide for yourself: http://tour.golang.org
      • Rust is also ugly, IMO
      • raggi
        reductionists vs. er, i don't know the antonym of reductionist
      • pnielsen
        Haskell is extremely complicated, but compared to Rust very beautiful
      • doomlord
        haskell has great ideas but you're right - the complexity re-emerges with monads
      • pnielsen
        I mean the syntax is ugly
      • doomlord
        but i really like the functional programming ideas
      • pnielsen
        Monads are actually rather ingenious, although they are hard to understand
      • smw
        as far as I can tell, rust and go are targeted at completely different things
      • pnielsen
        Nothing in Go is hard to understand
      • doomlord
        i read go can do if result,ok=blah(...) ok:{ ......}
      • raggi
        put it this way
      • pnielsen
        smw: Rust was inspired by Limbo and Newsqueak
      • raggi
        the rust tour doc is the size of the go specification
      • smw
        pnielsen, that means nothing to me
      • doomlord
        synticatically easy to put error checks in... that should be as good as monads
      • pnielsen
        doomlord: if val, ok := map["foo"]; ok { ... } else { ... }
      • doomlord
        and that works as compound expression returning the var ok ?
      • smw
        pnielsen, I see
      • doomlord
        (for the if)
      • raggi
        pnielsen: honestly, it feels like it was inspired by too many things
      • smw
        pnielsen, I stick by my original statement
      • pnielsen, they are made for different things