Fork me on GitHub
#off-topic
<
2017-04-12
>
benbot05:04:25

@john immutable OO still has the issue of classes breaking when other classes change

john05:04:48

not if classes are immutable šŸ˜‰

noisesmith05:04:51

immutable ... change šŸ˜„

noisesmith05:04:19

this is why it's so good that clojure makes it hard to use OO without designing interfaces first

benbot05:04:21

yknow if i wrote my classes into stone tablets it probably wouldn't be that bad šŸ™‚

elena.poot05:04:38

bet they'd be slow

benbot05:04:54

idk StoneVM has gotten a lot better

noisesmith05:04:55

the fact that defrecord doesn't just let you make up new methods ad-hoc has saved me from so many half-assed poor design decisions...

benbot05:04:28

I love looking back on bad design choices

benbot05:04:41

it's a good feeling

seancorfield05:04:45

Every mistake is a learning experience!

elena.poot05:04:56

only after you debug it šŸ™‚

benbot05:04:58

shudders java php

john05:04:04

I really haven't messed much with clojure's OO.

john05:04:34

I prefer to build everything in raw data first

john05:04:47

If something shines, then I'll make it a datatype.

noisesmith05:04:52

well - every time you call seq (or call something that implicitly calls seq) you are leveraging clojure's OO

noisesmith05:04:04

though you don't have to think about it

elena.poot05:04:06

I built an entire OO library in clojure before I knew better. Chucked it out and replaced it with a more functional design in 1/3 the code that runs faster and uses less memory.

seancorfield05:04:11

I switched to Java from C++ in '97 because I'd gotten frustrated with the complexity and obscurity of a lot of C++'s quirks. At first I liked the simple syntax and English-like "prose" of Java... up until around Java 5 šŸ™‚

benbot05:04:43

C++ is getting kind of crazy. The lambda syntax uses every kind of bracket

benbot05:04:53

[](){<code>}

seancorfield05:04:26

@noisesmith I think that's a confusing way to look at Clojure tho' ... thinking about the OO-ness inherent in the abstractions ... you're thinking about implementation details, IMO.

noisesmith05:04:05

Once I wrote an elisp program that produced every unicode character that was a "matching delimiter" - I wonder if I still have that around somewhere - there are so many that are unused

seancorfield05:04:16

@benbot Yeah, I agree. I have a hard time with what C++ has become since the '98 standard

elena.poot05:04:36

algol had some that could only be created if you could backspace and overstrike 2 characters šŸ™‚

benbot05:04:41

@wottis yeah it really does change your mindset

elena.poot05:04:59

(I think it was algol, never used it)

benbot05:04:18

how did the implement that?

seancorfield05:04:24

@terry.poot I wanted to write my final year uni project in Algol 68 but my supervisor wouldn't allow it...

elena.poot05:04:46

well, you were sitting at a typewriter/terminal, so you typed a paren, hit backspace and typed a dash

noisesmith05:04:13

@seancorfield I think implicit datatype polymorphism based on shared interfaces is OO whatever you call it - eg. when I compare using collections in OCaml where I have to always remember to call List.fold vs. Array.fold etc... (until I start using OO in OCaml, then I can use A#fold and B#fold regardless of implementation type, but I probably need to define that myself because OCaml library writers don't tend to like to use the object system in that language)

john05:04:39

The thing about clojure though... I'm not smart enough to wax poetic on the "expression problem" but I've read and I have a strong feeling that clojure solves that problem with namespaces in a way that, going forward, all new languages will have to at least meet. Monkey patches that break things everywhere, you don't hear about much in clojure.

elena.poot05:04:43

@seancorfield at my college, the profs were arrogant enough to say they could understand anything we could write, so we could use any language available at the university. I honestly did 90% of my homework in APL

seancorfield05:04:09

@noisesmith You seem to think in very OOP terms... and I suspect static typing terms too... no wonder Clojure seems to be error prone šŸ™‚

john05:04:16

and when you pair that with how extensible clojure is, in datatypes and macros... are there any features that cannot be bolted onto clojure with libraries?

seancorfield05:04:48

@noisesmith FWIW, I've been trying to learn Haskell properly for 25 years and the static type system just doesn't sit well with me

qqq05:04:29

it's hard to bolt on a type system

noisesmith05:04:30

haskell is poison for me - too theoretical and I get nothing done - I can manage in OCaml but there's no way I'll be making an Enterprise app with OCaml anytime soon

qqq05:04:33

all projects that have tried so far has failed

elena.poot05:04:42

For those that don't know APL, it was the first language I saw described as a write-only language (perl was the second, and doesn't hold a candle to it)

john05:04:10

Is core.typed really a failure? or does annotating types just suck?

noisesmith05:04:33

it's kind of uphill to try to use it, from what I gather

seancorfield05:04:43

@terry.poot My final year project was to write an APL interpreter. Small world I guess.

qqq05:04:43

@seancorfield : did you succeed? I've always gotten stuck at parsing APL ....

seancorfield05:04:51

(I wrote it in Pascal b/c I wasn't allowed to write it in Algol 68)

qqq05:04:00

I've heard https://dfns.dyalog.com/n_parse.htm was the way to do it, but never did it.

seancorfield05:04:05

Oh yes, fully functioning APL interpreter. It was fun.

elena.poot05:04:19

what's really fun is when the only printer you can print on only does ascii (APL has its own character set). That turns barely readable into illegible. Kudos to the faculty for keeping their word though, they never told me to stop. Even had one prof try to help me turn my two line homework program into a one-liner, but we failed.

seancorfield05:04:58

The department bought an APL print head for their Diablo teletype so I could print programs properly...

elena.poot05:04:33

I wrote an apl interpreter in fortran based on a series of articles in Byte when I was in high school. Until the teacher made me stop, because my program was a whole box of punch cards and he was tired of carrying it back and forth to the district office where the mainframe was.

seancorfield05:04:36

I'd encountered APL during my industrial placement year at an insurance company and I was totally fascinated.

seancorfield05:04:15

Ah, Byte magazine... happy days!

john05:04:19

lol teletypes and punch cards

seancorfield05:04:55

At uni we backed programs up onto punch tape. Have a care, young whipper-snapper! šŸ˜†

elena.poot05:04:13

yep, one run per day because the cards went to the district office at night and came back with printouts the next morning.

noisesmith05:04:50

the first person to teach me to program was an experimental composer who had a fortran program that he drop off at the mainfraime (as a stack of cards) and the next day he would pick up the cards and a reel of audio tape. Due to the nature of his hand rolled audio software he had to use a desk calculator and slide rule to figure out the parameters that would lead to a specific pitch output.

noisesmith05:04:07

this was all well before I met him though

john05:04:41

I don't have any cool ancient coding stories šŸ™‚

john05:04:04

But I was on the clojure bandwagon since like 2007 or 8!

john05:04:08

counts for something šŸ˜‰

elena.poot05:04:10

actually being ancient is a prereq šŸ™‚

elena.poot05:04:54

Always been fascinated by lisp and its ilk. Was totally shocked when my boss agreed to let me use clojure. I was going to campaign for scala because I thought that was as far as I could get. Note to people trying to sell your boss on functional programming, the phrase "100% test coverage" is effective.

noisesmith05:04:26

maybe it's just my team but I find people don't write tests, I keep leading workshops and encouraging people but I don't have the authority to mandate writing tests and people just play with it in the repl until it works and don't check in any test code

noisesmith05:04:54

probably just a culture thing I guess

qqq05:04:27

you guys are old; I started with Visual Basic.

noisesmith05:04:33

the more I talk on this channel tonight the more I feel like I need a vacation, hah

elena.poot05:04:12

a lot of it is. management has to buy in and mean it. TDD can actually be effective in an OO language, but yeah, the repl is quick and easy and effective, but ephemeral. In my case, my stuff got shoved from R&D straight into production, so I'm only up to about 50% or so, but I try to extend that when I can.

seancorfield05:04:18

Re tests:

Clojure build/config 15 files 1382 total loc
Clojure source 181 files 38772 total loc,
    2582 fns, 679 of which are private,
    329 vars, 16 macros, 39 atoms
Clojure tests 115 files 12395 total loc

elena.poot05:04:39

I like having good tests. I have a tendency towards scorched earth refactorings, and I like having a safety net. šŸ™‚

akiroz05:04:29

not really old but I came from a hardware background and started with assembler for the intel C51 chips... crazy stuff.

elena.poot05:04:22

One of the things I loved about C was i didn't have to write any more assembler

seancorfield05:04:54

I enjoyed writing assembler...

elena.poot05:04:28

... for a little while. Then it just got to be too much work to get anything done.

akiroz05:04:33

ehhh.... finding stuff in the thick paperback programming manual wasn't all that fun. mine had bookmarks sticking out all over the place

seancorfield05:04:42

When folks ask me "What books would you recommend for learning X?" and I think "Gee, there were no books on X when I learned it..." /graybeard

seancorfield05:04:26

I still have my copy of "Programming the 6502" by Rodney Zaks, if that helps!

elena.poot05:04:59

Lost mine along the way (and it might have been a different book but the title was similar)

akiroz05:04:14

Haha, nowadays people are are asking for online interactive learning experiences šŸ˜‚

elena.poot05:04:53

I like text. I read faster than people talk, and I don't need to work all the problems (only the ones I don't know how to solve).

seancorfield05:04:23

I remember when the "Head First" series started to appear and I was like "WTF?"... šŸ˜†

seancorfield05:04:53

I think things have changed so much in this industry that some of the basic touchstones have changed too.

seancorfield05:04:13

No one learns about memory models and pointers and registers any more...

elena.poot05:04:32

tutorial style books drive me bonkers. "Just do this, see what happened, isn't that cool?" Why did that work? "That's in the next chapter"

seancorfield05:04:38

(witness the recent discussion of barriers and memory models on the mailing list)

elena.poot05:04:07

I had to teach a young co-worker about bit manipulation. They don't teach that anymore. He had a masters degree.

elena.poot05:04:43

On the one hand, understanding those things is undeniably helpful. On the other hand most people will hardly use it at all. So while part of me thinks everyone should learn C and have to debug pointer problems, part of me realizes this is tantamount to torture, since they'll (probably) never have to do it again.

akiroz05:04:28

and I thought my school changing the CPU design course project from using a hardware description language to C was insane....

akiroz05:04:15

apperently none of the CompSci students got the hang of writing declarative code that models hardware

seancorfield05:04:53

I'm in two minds... we did a compiler design course and being able to understand how some (virtual) machine works is, to me, very important as a fundamental basis for computer science.

seancorfield05:04:11

It doesn't need to be particularly practical or specific.

seancorfield05:04:22

But the concepts are important.

elena.poot05:04:08

I agree, but then I do have that grounding. Yet most of my co-workers don't have that background, and for the most part, it doesn't really hurt them.

elena.poot05:04:37

modern systems are too civilized. there's benefit to throwing the kids out in the wild with a knife and a loin cloth as a rite of passage. šŸ™‚

elena.poot05:04:55

or manage their own memory space, as the case may be

seancorfield05:04:47

Yeah... that's why I'm in two minds...

seancorfield06:04:36

...in so many ways, modern computer systems shouldn't require any of that knowledge (but I don't quite think we're there yet?).

elena.poot06:04:44

Well, they don't. Unless you're one of the people building the stuff that makes that possible. The problem is, too few people can do that, so things like JVMs are black magic to most coders.

john06:04:55

In java classes, they'd start by saying "let's do something simple and print something to the screen with public static void main(String args[])... oh, don't worry what all those words mean - we'll tell you what void means later."

john06:04:00

just a whole lot of convention without starting with what the meaning of the terms are.

john06:04:35

so I'm working on a CLJS concurrency library using webworkers. I'm trying to model them as closely to Agents as possible. But they're mostly built on simple atoms. For remotely owned state, you leverage send to change it. But I'm thinking about supporting ISwap for the worker that locally owns the state.

john06:04:14

Anyway, I'm wondering about a name... Just Agents? or I was thinking maybe Molecule, like a network of atoms?

seancorfield06:04:29

Aw, I'm sorry @john but you've wandered back on topic and you should take that to #clojurescript šŸ™‚ šŸ™‚

john06:04:51

sorta šŸ™‚

john06:04:12

I'm too on-topic for off-topic lol

sveri08:04:38

Re: ancient topics in CS degree. One of the biggest enlightments I had was when I finally understood pointers in C, which was actually recommended before I started my university, it took me several months back then. We also did a lot of graphic and database stuff at our university, none of which I use today. During my years as a professional and student (I did a lot of computer related work back then already) I did a lot of very different stuff, network administration, exchange server stuff, active directory, linux setup in small offices, creating several programs with the W32 API, building web pages, ... I hardly ever directly applied what I learned in my studies there, but there are two things that are important and where I agree with @seancorfield: 1. the concepts you learn 2. The ability to learn about a topic / problem and being able to solve it as well as the self esteem to being able to do so. Thats why I also find it intriguing so many jobs are related to a specific programming language, especially in a corporate environment. Getting into a new technology takes me days to weeks, depending on the topic and the tooling environment which is nothing compared to the other skills that one acquires over its years. To make point, I think it does not matter if you teach punch cards, C, or OOP concepts or whatever, as long as you teach, and teach students to learn for themselves. And of course, as long as you teach mathematics šŸ˜„

kevin4210:04:47

Any idea if there's already a tool to parse email list archive like this http://www.biglist.com/lists/jats-list/archives/#browse

imetallica13:04:29

@noisesmith I find Haskell enlightening in many parts, but sometimes frustrating because of the ā€œacademic languageā€. But thatā€™s because, well, itā€™s the community that they are in. Now that people are seeing value in functional programming languages, maybe the early adopters - and I mean the early adopters outside of academy - will bring it closer to the masses without all that Mathematical-ish jargon.

seancorfield13:04:09

But that "mathematical-ish jargon" really is just the core underpinnings of computer science and the root of being able to build correct, simple (in the maintainable sense) software.

benbot14:04:13

yeah but it can hinder you when youā€™re trying to be a bit more practical. The ideals are what you want to take away more than the semantics imo

benbot14:04:53

itā€™s kind of the difference between science (or academia) and engineering. I think haskell is a good science language that people like using for engineering

benbot14:04:07

kind of like how python is a good engineering language that was taken up and made good for science

mpenet14:04:29

It's all a matter of learning curve ultimately, takes ages to learn to produce non-shitty quality haskell code, then there's a high level of chance that if you get employed to code in haskell people there might have a very different style too (many ways to do the same task). Most popular langs make things simple and boring : ex: go, python etc

mpenet14:04:44

and that's why these are the language that are used in "science" (at large) too, most don't have the patience/time to get up to speed

mpenet14:04:55

most of the people I know working in "science" (physics, ee, etc) use python/go/c/java/fortran(!) and probably never even heard of Haskell

benbot14:04:50

Haskell is much bigger in academic mathematics

fellshard14:04:57

The same could be said for, e.g., chemistry. Anyone can start mixing chemicals without knowing what's going on, but you'd better have some idea of the underpinning theories when things go wrong, or when you're asked to alter things arbitrarily.

fellshard14:04:17

A lot of what happens in a CS degree is intuition tuning.

benbot14:04:27

idk if i agree with that

benbot14:04:47

CS degrees vary waaay too much depending on what uni you go to

benbot14:04:16

The uni near me has an awful CS programā€¦ itā€™s basically poor training for 30 year old problems

mpenet14:04:18

yes but a lot of the stuff that's considered basic CS knowledge (algo, data structures, sys etc) is not something exclusive to functional programming (or haskell)

benbot14:04:33

that isnā€™t even taught well (or at all) at some unis

benbot14:04:56

The one I went to actually removed their discrete math class

benbot14:04:14

replaced it with a more practical, more watered down version

fellshard14:04:35

The mathematical theory of computation is a very different space than the mathematical basis used for functional langs such as Haskell. One's an underlying reality (discrete math and logic), the other is a modeling tool.

fellshard14:04:02

The underlying reality is highly important to know, even if it's just enough to get by.

benbot14:04:27

yeah but a basis in that reality can give context to the computation theory

fellshard14:04:56

I'd still argue a functional language is a better way to start students thinking about modeling, but don't know if it extends to pragmatism in a career.

benbot14:04:04

oh for sure

benbot14:04:19

SICP was the intro to programming textbook for MIT for like 40 years

mpenet14:04:30

isn't it python now šŸ™‚ ?

benbot14:04:32

but until recently it was much harder to get a job without OOP concepts

mpenet14:04:40

but I wouldn't worry for MIT students

fellshard14:04:42

With our luck it'd be JS šŸ˜›

benbot14:04:45

I think it was because the professor got bored though lol

benbot14:04:24

I remember reading and interview about why they changed and it sounded kind of like a mix of ā€œiā€™m bored of that bookā€ and ā€œprogramming today is more about using other peopleā€™s work than making your ownā€

mpenet14:04:35

well as boring as python is, it's used everywhere and quite good at a lot of things

dominicm14:04:45

I think the professor who wrote SICP left. A year or two later they switched.

benbot14:04:36

I think heā€™s still there

benbot14:04:44

idk last update 2014

dominicm14:04:26

I might be thinking of something else tbh šŸ™‚

dominicm14:04:42

I hate that we consider "programming by poking" the new norm.

benbot14:04:01

I think itā€™s a really great way to introduce yourself to programming

mpenet14:04:17

if your in the field it shouldn't be, but nowadays everybody uses programming

benbot14:04:30

then when you want to start writing good software, the lessons and ā€œahaā€ moments you get are much more impactful

dominicm14:04:01

@mpenet s/programming/poking ?

benbot14:04:09

I learned by that ā€œpokingā€ method until I started reading about good OOP design in ruby, then went through that Land of Lisp book and the amount of realizations i got

benbot14:04:49

left quite an impact

benbot14:04:07

I think you get a different view going from the theory up

dominicm14:04:38

Me too. Clojure feels significantly less "pokey," the source code is readable, the libraries are simple, it's a nice world.

benbot14:04:39

When I first learned about immutable state I didnā€™t really get why my team was so into itā€¦ but something happened where I traced back all the state changed to some weird function callā€¦ and my eyes were opened 0.0

benbot14:04:26

idkā€¦ Iā€™m a fan of the programming by poking method for intro courses

benbot14:04:04

@dominicm I like how funny the community is with a lot of thingsā€¦ like lein and figwheel

benbot14:04:10

good sense of humor

kevin4214:04:20

python is a good one too for humour.

benbot14:04:52

iā€™ve only used python for playing around with MLā€¦ no humor there šŸ˜ž

kevin4214:04:55

There's an article about ML and fizzbuzz http://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/ It's a fiction where the interviewee use ML to solve fizz buzz

kevin4214:04:05

The name python comes from the Monty Python and a few things makes a references to them as the cheese shop which is python package index.

akiroz15:04:36

My first functional language was Standard ML... taught in a programming languages course. (oh wait, are we talking about Machine Learning? šŸ˜›)

akiroz15:04:24

I'm really not a huge fan of python... the tooling just feels like using some shell script people hacked together. I'd take npm over pip any day, it may be slow but it works!

akiroz15:04:27

I think poking is a great way to get started with a language, it gets me motivated to learn more about it after seeing things work.... This didn't work for me with Haskell though, I spent 2 days trying to get a JSON endpoint up and failed (gave up after that). I think I can sacrefice some elegance/correctness for simplicity by sticking with Clojure for now...

fellshard16:04:04

Haskell puts a lot of weight on modeling things up front based on a very wide set common abstractions; if you screw up the modeling, everything else becomes difficult to change. Comprehensive knowledge of your modeling tools is essential. Clojure uses a narrow set of common abstractions instead; perhaps harder to specify exquisitely mathematical models in the same way Haskell can, but since Clojure uses more general-purpose abstractions, it's easier to mold and shape it to shifting needs.

qqq17:04:21

there's also things like databases, where the schema is provided at runtime; in clojure -- you use a map; in haskell, you have to do some crazy generic category foo to have some piece of data that satisfies this generic schema

benbot17:04:52

@akiroz have you seen yarn? Itā€™s a billion times better than npm

benbot17:04:31

Also I think lisps are pretty elegantā€¦ maybe not correctā€¦ but still elegant

gazaxian17:04:23

I quite like haskell but itā€™s super brittle, all of the work is in trawling through unintelligible errors getting your code to compile

gazaxian17:04:41

which isnā€™t always fun

gazaxian17:04:04

I like clojure but all the effort is making sure it runs in a number of edge cases, usually always compiles šŸ˜„

gazaxian17:04:31

currently looking at spec tho, that should help me avoid some schoolboy errors

noisesmith18:04:11

I donā€™t like haskell actually, but Iā€™m amused to see a clojure fan call its errors unintelligible

akiroz18:04:29

benbot: yep, been using yarn for a while now~ šŸ˜„

benbot18:04:49

Emojis are great in it :)

gazaxian18:04:30

they are prettty unintelligible, and I do a lot of C++ template metaprogramming šŸ˜„

firstlast18:04:00

Code tree on github .... better file navigation .... https://github.com/buunguyen/octotree

akiroz18:04:43

speaking of haskell, I found the language pragmas to be quite a pain....

gazaxian19:04:40

Wow that code tree is awesome

gazaxian19:04:46

cheers for the tip šŸ™‚

mobileink20:04:34

is there a "law" for how progress slows as you get closer the the finish line? i've been about 2 days from an official release for about 2 months now. the farther in you get, the more expensive it is to change anything, even if it's small, since at least you have to go through all of your wonderful sample code and documentation. so the last 10 % seems to take about 95% of the time. seems like there ought to be a witty "Fuber's Law" along those lines, but i can't recall one. e.g. once you get past x% done, every additional % done will cost you 100-x + delta, so you're not done until you've spent well over 100%. :)

noisesmith20:04:58

sounds like the natural consequence of the pareto principle (you get 80% of the result in 20% of the time, meaning your progress slows by 400% once you are in the last 20% of actual result left)

noisesmith20:04:45

if the pareto principle was a recursive phenomenon, that would mean each remaining portion would take 4x as long as the previous step

mobileink20:04:51

hey, i've even heard of that. sounds about right. but it lacks charm.šŸ˜‰

noisesmith20:04:51

also, in my experience, if I find that changes are getting difficult to implement, that can be a learning experience I can apply to my next design

mobileink20:04:04

what i'm experiencing now is not so much that a particular change is hard to implement, but that the system has attained a degree of complexity that means it takes longer and longer even if it is simple (you not only make the source changes, you have to make all the test, doc, etc. changes - and then you have to review and double-check it all ad infinitum).

mobileink20:04:18

the closer you get to "done", the longer it takes to finish.?

noisesmith20:04:51

sounds exactly like Xenoā€™s paradox

mobileink20:04:01

wow! i just looked that up on goigle!

mobileink20:04:35

i mean before i saw your msg. must be right.

mobileink20:04:57

Xeno's (Zeno's?) Law of Software Development?

noisesmith20:04:24

oh, right, itā€™s Zeno

mobileink20:04:33

"You can't get there (done) from here (almost done)."

mobileink20:04:16

of course we have "real artists ship" (S. Jobs, or so I've heard), but i prefer Valery's "A poem is never finished, only abandoned."