« first day (1431 days earlier)      last day (3516 days later) » 

user1804599
7:00 PM
Rich Hickey is my hero.
 
user1804599
He appeared in one of my dreams.
 
user1804599
user> ($= 7 + 8 - 2 * 6 / 2)
9
 
user1804599
Whaha this library.
 
?
that's correct?
 
I really need something to do
 
7:02 PM
I wonder if there's someone who got some software and then legitimately said "I don't agree" to the EULA
and never used that software
 
user1804599
@SamDeHaan $= macro converts infix notation to prefix notation.
 
user1804599
@AlexM. I tried to install Zoo Tycoon when I was like 8 and the installation failed because I clicked "I don't agree" every time. I did that because I had no idea what the fuck I was doing.
 
lol chibi rightfold
 
@rightfold you were not very smart
 
user1804599
7:05 PM
I were not very fluent in English.
 
... reasonable enough I guess...
 
user1804599
They didn't yet do half of all lessons in English in elementary school back then.
 
I remember reading about this in a talk right here, but I forgot what it was about
 
user1804599
@AlexM. It also whines when you add "jure" to your project name, which is fucking horrible.
 
user1804599
 
7:07 PM
did someone in this chat post an issue to some repo about the jure thing or that?
yeah that's it
that is what I was remembering
 
user1804599
Especially because the error message doesn't mention the reasoning behind it.
 
user1804599
And people might believe it would have technical consequences, when it doesn't.
 
user1804599
I will from now on incorporate "jure" in the names of all my Clojure projects as a revolt!
 
well, I've loaded a default project and ran the hello world
looks like it works
 
@rightfold ahahaha
 
user1804599
7:11 PM
The environment variable to turn that bug off is called LEIN_IRONIC_JURE.
 
oh fuck
I did so many bad things to my repo :S
 
hardly
 
also fuck forks
how can I make my repo not be a fork
 
user1804599
Don't fuck forks.
 
no, fuck idiots who can't work out what they are doing
 
user1804599
7:13 PM
@BartekBanachewicz git clone … && git remote set-url origin … && git push.
 
@BartekBanachewicz You have to write to support
 
damn it
well okay
I'll just merge this last branch somehow and recreate it
 
@rightfold so... is that thing still applying?
I mean it looks like a restriction inserted because somebody didn't like project names that ended in "jure"
 
@BartekBanachewicz I pass. I simply don't know anything about Lua or Parsers in general and I'm not interested in learning either of those. I don't have enough motivations; sorry.
 
which is immeasurably retarded, if that is true
 
user1804599
7:19 PM
@AlexM. yes.
 
user1804599
@AlexM. exactly
 
user1804599
Remove it in a pull request that contains lots of other stuff as well and don't mention it. :P
 
@Jefffrey sure np
 
jesus christ i always turn you down
i just realized that
the unconference, the jams, the lua parser now
 
7:21 PM
@Jefffrey really?
@Jefffrey lol
 
That's what she said
 
@Daniel global state + malloc + lack of RAII => RUN AWAY — Mgetz 22 secs ago
 
i'm a "no man"
 
@CatPlusPlus am I the only one reading LEIN as Lenin?
 
let's not forget lenses
 
7:23 PM
@Jefffrey I don't mind. I prefer you be honest rather than "maybe" or even worse "yes" and then fuck it.
 
How should I know
 
user1804599
@AlexM. Lein always reminds me of Lenin too.
 
user1804599
And the guy on the Leiningen website doesn't help too much either.
 
       it "should parse multiple assignments" $ do
            (parse "x,y=1,2") `shouldBe` (Block [Assignment [LVar "x", LVar "y"] [Number 1.0, Number 2.0]])
glorious tests :3
 
@BartekBanachewicz who would do that? :S
 
7:25 PM
@thecoshman a lot of fuckers around
 
Guilty
 
@rightfold lenin looked pretty badass trendingriver.com/wp-content/uploads/2014/04/lenin.jpg
putin is fugly compared to him
 
user1804599
Still not as badass as Bjarne.
 
@Jefffrey, no, there's a reason why const is not transitive with regards to pointers and references. — avakar 1 min ago
what is this guy talking about?
 
user1804599
C++.
 
7:35 PM
wait, clojure doesn't have car, cdr and so on
 
They're probably called in a non-idiotic way like first and rest
called named whatever I'm tired
 
user1804599
26
Q: What causes morning wood?

I JSometimes men wake up with an erection in the morning. Why does this happen?

 
user1804599
TIL
 
user1804599
@AlexM. It has first and rest.
 
user1804599
They apply to non-lists as well.
 
7:41 PM
> Bertelsmann Code of Conduct – RTL Group version
This is gonna be good.
 
user1804599
There is also next which returns nil instead of () for empty inputs.
 
I tried to write a function that adds up a variable number of arguments and failed it seems
first/rest does make sense but I got attached to car and cdr :(
 
user1804599
(defn add [& xs] (apply + xs))
 
user1804599
Or (def add +).
 
yeah I wanted to make it recursive and on each step take out a number from the parameter list
 
Xeo
7:44 PM
om nom nom food
 
(+ (first xs) (add (rest xs)) when xs is not empty should have worked, right?
 
Xeo
@CatPlusPlus So, what did you do in the end wrt foodz?
 
and it returns 0 when xs is empty
 
user1804599
(defn add [& xs]
  (if (empty? xs)
    0
    (+ (first xs) (apply add (rest xs)))))
 
is there a reason you called apply?
 
user1804599
7:45 PM
Yes: add is variadic (notice the &).
 
let me read about that
 
user1804599
It's pretty simple.
 
"Happy New Dick!".
 
user1804599
(defn f [first-parameter second-parameter & list-of-all-subsequent-arguments] …)
 
user1804599
Hmm.
 
7:48 PM
Implement I-expressions in Clojure
 
user1804599
(defn slow-+
  ([] 0)
  ([& xs] (+ (first xs) (apply slow-+ (rest xs)))))
 
user1804599
@AlexM. this one is nicer IMO.
 
that's arity overloading from what I've read
sorta like the how it's done in haskell to specify particular cases
or prolog
wait no
 
user1804599
There's a pattern matching library for Clojure but defn only deals with arities.
 
it's the same arity
 
user1804599
7:52 PM
Even nicer:
 
user1804599
(defn slow-+
  ([] 0)
  ([x & xs] (+ x (apply slow-+ xs))))
 
user1804599
There's also a static typing library for Clojure. :V
 
@rightfold I'm experimenting with that stuff, this is fun
for
(defn some-stuff [x y & z]
  (println x "." y "." z))
=> (some-stuff 1 2 3 4 5)
1 . 2 . (3 4 5)
this is seriously cool
 
user1804599
 
did you pull req?
lol
 
user1804599
7:57 PM
no lol
 
user1804599
@AlexM. (apply some-stuff 1 2 [3 4 5]) should give the same result.
 
> Account Recovery Key
project euler almost reached MMO-levels of security
now they only need authenticators
 
@Jefffrey I am sure I'll find something you'll be interested in one day :P
 
i hope so, or maybe viceversa
 
@BartekBanachewicz find rightfold
 
user1804599
8:02 PM
@AlexM. this is also fun, run this in the REPL:
 
user1804599
(import [javax.swing JFrame])
(def frame (JFrame.))
(.setVisible frame true)
 
user1804599
; then run this as well:
(import [java.awt Color])
(-> frame (.getContentPane) (.setBackground Color/RED))
 
user1804599
Nothing is as fun as developing a GUI with a REPL!
 
user1804599
Apart from everything that isn't related to GUI development, of course.
 
> CompilerException java.lang.ClassNotFoundException: Color.RED
but it showed a frame
so I guess that part works
 
user1804599
8:05 PM
I edited the mistake. :v
 
oh right
 
fuck
Call is an expression in my AST
 
oh wow, it's red
 
user1804599
(-> a (b) (c d) (e f)) is equivalent to (e f (c d (b a))).
 
@rightfold should I make expressions convertible to statements?
 
user1804599
8:06 PM
No.
 
I should make a browser in the REPL
 
user1804599
Have expression statements.
 
@rightfold Do I just call that ExprStmt ?
 
user1804599
An expression is not a statement, so don't make it one in your design.
 
user1804599
Yes.
 
user1804599
8:07 PM
@AlexM. Use Jython and import antigravity.
 
I wonder if I want to allow arbitrary expressions as statements though
5; is not a valid statement
 
user1804599
As long as you don't have assignment expressions I'm fine with everything!
 
user1804599
@BartekBanachewicz meh, unneeded complexity.
 
@rightfold I want to make it rathaer compatible with Lua :S
and Lua forbids this fucking 5
 
Ell
8:08 PM
@BartekBanachewicz doesn't the lua spec define it?
 
user1804599
Then follow Lua's rules.
 
how do I specialcase some Expressions though
 
Ell
@rightfold why don't you like assignment expressions?
@BartekBanachewicz it allows some expressions and not others?
 
user1804599
Because assignments are dangerous and as such they should stand out and not be hidden inside larger expressions.
 
I need to say that "some expressions can be converted"
@Ell apparently
 
user1804599
8:09 PM
And if they are expressions, make them return Unit and not the new value; CQS.
 
nah, Assignment is a Stmt
 
user1804599
Good. :3
 
hmpfh I wonder what expressions can't be converted to statements
string literals: nope
nil: nope
 
user1804599
@BartekBanachewicz Docstrings!
 
ellipsis: nope
 
user1804599
8:12 PM
 
user1804599
@BartekBanachewicz Add dynamically checked type annotations like PHP has except make them work with built-in types!
 
user1804599
Screw Lua compat!
 
@BartekBanachewicz Only function calls and assignments can be statements.
 
assignments should be statements in general
but yeah, only function and member calls (well calls in general)
suck
 
if you permit operator overloading though you can't do any such thing
which Lua does and is therefore wrong in this regard.
 
8:14 PM
well fuck
 
user1804599
Just make operator@ identifiers and make them name global multimethods.
 
definitely no.
especially if he wants Lua compat.
 
user1804599
Screw Lua compat!
 
So CallStmt it is
 
Ell
@rightfold but doing a = b = c = d = e = f = g = 10 is cool!
 
8:16 PM
Sep 9 at 13:57, by Puppy
you could simply try the Rightfold Defence
 
user1804599
@Ell Python allows that, yet assignments are statements.
 
Ell
and them all equalling 10 is much less surprising than all but g equalling unit
 
Sep 9 at 13:57, by Puppy
"Your requirements make my ideal solution awkward or impossible? Just change the requirements!"
 
user1804599
@Puppy Reminds me of you, actually.
 
Ell
8:17 PM
@BartekBanachewicz yeah, I've never ever done it :L
 
@Ell variables suck
constants > variables
 
Ell
I disagree strongly :P
 
It depends really.
 
fuck that
 
Ell
what can you do with a constant that you can't do with a variable? :P
exactly ;)
 
user1804599
8:17 PM
Apr 26 at 16:22, by DeadMG
@rightfold Now imagine that my protocol gets changed from integers to floats, and the output on the other guy's machine uses a comma as the decimal separator.
 
@Ell reason about the program's behaviour in an easy way
 
user1804599
"I cannot use X for Y because it's not suitable for totally unrelated Z!"
 
Ell
yeah I guess pi is extremely easy to reason about
 
If the thing you are trying to model is stateful, then it's ok to use a variable.
 
@Ell yes it's fucking pi
@Jefffrey I prefer State over variables.
 
8:19 PM
I've seen you use MVar sometimes.
Or whatever that's called.
 
not M and T and not used but wrapped in StateT instance
at least in potato
 
user1804599
In Styx you can implement a mutable variable using two channels and a thread.
 
@Jefffrey also yeah TVar > ordinary variable
and STM > IO
right @Ell I am sure you agree with the above
 
Ell
wait a minute
I think I massively understand what you mean by constant
or rather we have different definitions of variables :p
 
@Ell for you variable resides in IO (iow completely unchecked)
for me variable state is way finer and is either in State or in STM
(STM being transactional memory)
 
Ell
8:24 PM
I thought you meant a variable as in a named value
versus a constant which is a constant variable
 
The amount of energy involved in a hurricane is comparable to the total power generation of mankind.
 
Ell
idk, I've been doing maths all day :p
 
"constant variable" is a fucking oxymoron
 
user1804599
A moron high on oxygen.
 
Ell
meh. you call x a variable in maths, but it never varies
@R.MartinhoFernandes no way jose
 
8:25 PM
@Ell yeah well that
 
Ell
@R.MartinhoFernandes that is cray cray
 
user1804599
Hurrykanye.
 
Ell
Would putting wind generators all over the earth prevent hurricanes from occuring?
 
user1804599
Ask Randall.
 
8:28 PM
We're using about 0.16% of the planetary budget, which is around 1.74×10^17 W.
 
fuck
I can't use CallStmt Call
Call is a constructor, not a type
 
Some 3 ×10^14W.
 
rghhh imperative languages
 
Ell
I wonder whose responsibility taking care of the current earth is, if anybodies
 
user1804599
Imperative programming. <3
 
Ell
8:29 PM
to me the incentive is so my children can have an earth as good as I had during my life
 
user1804599
@BartekBanachewicz Use case classes in Scala!
 
@rightfold woah
does it allow that?
 
Ell
Yeah
 
pretty nice
 
@R.MartinhoFernandes oh well, I'll stop turning lights off then
 
user1804599
8:30 PM
sealed abstract class Expr
case class CallExpr(f: Expr, args: Seq[Expr]) extends Expr
case class IntExpr(value: Int) extends Expr

sealed abstract class Stmt
case class CallStmt(call: CallExpr) extends Stmt
 
I simply did CallStmt Expr [Expr], like Call
 
Fucking hurricanes just got a whole lot scarier.
 
user1804599
These are now all distinct types, with subtyping relationships.
 
Ell
writing parsers in scala is muy facile
 
nice
inb4 ScalaParsec
 
Ell
8:31 PM
scala has parsing in the standard library
IIRC
 
user1804599
There is a monadic Scala parsing library AFAIK.
 
Eh there's too many languages on the planet
Can't use them all at once
 
Ell
scala-lang.org/api/2.10.3/… <-- it has parser combinators in stdlib
 
user1804599
@Ell lol 2.10.3
 
how incredibly dumb of them
 
Ell
8:32 PM
@rightfold idk, first result :P
 
user1804599
It was removed from the standard library.
 
user1804599
 
lol test failed because no show pattern
@Puppy why? C++ has cin
 
yes, and it's rather stupid and also not really the same thing.
 
8:34 PM
but leaving aside the fact that cin is incredibly broken and not the same thing at all
 
user1804599
Parser[T] appears to have map and flatMap, so you can use it with for expressions.
 
it's dumb because they're special-purpose.
the Standard library of a given language should only contain general-purpose features.
 
Xeo
What's not general-purpose about a parser?
 
Ell
I think the core should
 
@Puppy what xeo said
 
user1804599
8:35 PM
@Xeo It is only suited for parsing jobs and not for anything else!
 
Ell
but it can include other stuff in it's extra libraries
 
parsing is itself a fairly special purpose.
 
it's really not
not having parsers in stdlib makes people write scanf or cin abominations
 
most users of a language are not gonna know or care if it only comes equipped to parse integers and nothing more.
 
bullshit
 
8:35 PM
@BartekBanachewicz No, them being morons makes them do that.
 
user1804599
Oh sexy val number: Parser[Double] = """\d+(\.\d*)?""".r ^^ { _.toDouble }.
 
@Puppy that and the lack of facilities in stdlib
 
user1804599
Should try that library soon.
 
oh yeah, because std::vector really made people stop writing shitty code with new[] and delete[].
also, I might care to mention that I think it probably doesn't matter for shit if they do write terrible parsing code because parsing is a trivially small job whose implementation can be replaced at nearly any time for a pretty low cost, and any non-moron can get the job done right first time or re-use a component that can do it.
unless you're talking about parsing something like C++ in which case God help you, stdlib parser provided or not.
 
Ell
I think parsing should include support for binary stuff
 
Xeo
8:38 PM
You should try using parser combinator libs once, Puppy. They're awesome.
 
Ell
then you get binary file formats too
 
@Ell Lexer problem, not parser.
 
Ell
I think it's kind of a small thing to implement that'd help a lot
 
@Puppy parsing isn't trivially small
 
Ell
@Puppy meh. sometimes they're combined, right
 
8:39 PM
assuming that you're not parsing C++, then it is.
 
even stuff like Lua takes considerable amount of time
 
the time taken to execute means little about how difficult it is to write correct code to perform that function.
 
Ell
parser combinators make it much quicker anyway
 
the simple fact is, any bozo should be able to shit out a simple recursive descent parser with not a great deal of effort for most grammars.
 
Ell
you're basically just writing the grammer
 
8:40 PM
sure, except the grammar isn't that big a part of it.
 
fuck you if you're not using declarative parsers in a code that's going to be read by others
Goggles do nothing
just look at ruby's parser if you want to experience what I'm talking about
 
eh, I've used Bison and it was definitely worse than just writing it myself.
 
Ell
@BartekBanachewicz which one?
 
@rightfold is there a way to give clojure some sort of type hints for parameters?
 
@Ell dunno, the one that was featured at This PLT Life
 
8:42 PM
IME the real problem with parsers is that the most common implementations, LL and LR, are both shit.
 
user1804599
@AlexM. yes but that's for performance only.
 
@Puppy but you're terrible at programming and life so yeah
 
(defn fac [x]
  (if (> x 1)
    (bigint (* x (fac (- x 1))))
    1))
so that I don't do the bigint "cast"
 
yep, just ad hominem me and move on.
 
user1804599
If you want static typing you can use the library I linked earlier.
 
8:42 PM
yeah, I was thinking that there may be something w/o the lib
 
@Puppy that's the proper response to "I used them and it was ok"
Sorry I just felt like saying something mean to you
but I really think that declarative parsers are ultimately much better
And my test just exposed a bug in my declarative parser
@Jefffrey how can I structure HSpec tests?
 
there's too much arsing around passing in the state that you need to construct the AST that you want.
 
@Puppy what?
 
user3010322
@Xeo Parser combinator libs?
 
@ThePhD like Parsec
 
Xeo
8:47 PM
Parsec
Or Spirit
 
user3010322
Ooh, spirit.
 
@BartekBanachewicz I usually create a test file per module and make subsections for each function of the module (except getters of course).
 
it's easy to make Bison parse your grammar, and a lot more effort to make it actually do something with it.
 
@Puppy uh... I don't use Bison. I just say "function is this and this or this" and then magic and I pass strings and get AST
@Jefffrey won't work in my case because I'm ultimately testing one function right now
 
8:48 PM
uh huh.
 
@Puppy wanna see the source?
 
sure.
 
@BartekBanachewicz Depends (heavily) on the grammar, IME. If you define your grammar so you can use recursive descent, that's usually the easiest way. If it doesn't (at least mostly) fit with LR(0), and does fit LALR(1), then a yacc-like system probably wins. Spirit can work nicely too, but compile times can be a serious problem--can be much slower than compiling a lexer with Flex, parser with byacc, and the results with C++ compiler.
 
@BartekBanachewicz Why only one?
 
-- A block/chunk is a series of statements, optionally delimited by a semicolon -
block :: Parser [Stmt]
block = many $ do
    s <- stat <|> laststat -- Not correct, could have many laststatements
    optional semi
    return s
@JerryCoffin I think spirit/parsec are ultimately more "low-level" than all formal-grammar based parsers, no?
@Jefffrey "parse"
 
8:50 PM
test also the subcomponents (other functions) that build parse
 
repeatStmt :: Parser Stmt
repeatStmt
    = do{ reserved "repeat"
        ; b <- block
        ; reserved "until"
        ; e <- expr
        ; return $ Until e (Block b)
        }
here's another one @Puppy (I have to rewrite this terrible style; I forked this project from author who abandoned it :S)
@Jefffrey hmm
that's an interesting idea
 
@BartekBanachewicz What if your AST needs more context?
 
I pass sample strings to the full parsing right now to verify that the parts work indirectly
 
like I dunno, the most recently used access specifier.
 
@BartekBanachewicz At least IMO, Spirit mostly seems low-level because it incorporates much of what would normally be in the lexer. Another possibility would be to use SNOBOL 4 or possibly Icon, which had pattern matching built in before Haskell's great grand-parents existed yet.
 
8:52 PM
the heck (NSFW)
 
@Puppy I think I'd separate it, tbh. I'd parse into internal representation and only then apply stateful modifications to the form that's edible.
 
@Jefffrey wat
 
user3010322
Hm.
 
hm
that's a bit inefficient (I mean in terms of your code size) instead of just parsing directly into the form that you need, isn't it?
 
user3010322
I wonder how flagrantly dangerous it would be to have my ~/ directory in my VM be directly linked to my C:/Users/{UserName} folder in the Host Windows OS.
 
8:55 PM
@Puppy code size being implementation size? That's rarely a problem in Haskell :)
 
I mean in terms of just you having to write more code.
 
Ell
@Jefffrey I like this song
 
@Puppy I think I'd rather write that code than hack state into the parsing stage then.
 
Ell
and the video is pretty good too
 
what do you mean, "hack state"?
 
8:56 PM
But I might be really really wrong about this
 
it's not a hack to just put state in the parser that it needs to produce a useful AST.
 
for a Haskell programmer every use of State needs to be justified :P
 
Ell
@Jefffrey idk how it's on youtube still though
 
my Lua parser won't need that, I think
there are no modifiers in Lua that apply to subsequent things
 
user3010322
You're parsing lua?
 
8:57 PM
Yes.
 
I don't think there are
but there's nothing different about "Most recently used access specifier" than "Most recently defined function".
 
So yeah I might be really wrong, but still that would be my initial approach.
@Puppy why would I need the latter?
 
@Jefffrey tastefully done
 
@BartekBanachewicz To put the statements in the function.
you can't have a function with a list of statements in it without knowing which function to put your statements in.
 
-- |"function statement" is just syntax sugar over
--  assignment of a lambda
funcStmt :: Parser Stmt
funcStmt = do
    reserved "function"
    fname <- funcname
    fparams <- paramList
    fbody <- funcBody

    case fname of
        (name, _) -> return $ Assignment [LVar name] [Lambda fparams fbody]
        -- TODO: proper resolution of LFieldRefs
@Puppy Consider ^
 
8:59 PM
@JerryCoffin Do those ancestors include ML? ;)
 
@LucDanton Yes.
 

« first day (1431 days earlier)      last day (3516 days later) »