Fork me on GitHub

I think, as long as I am granted the Either and State Monads, I'm willing to forsake all other Haskell monads.


Something to consider though...I've learned the hard way that trying to get monads into a language (unless that language was built on monads like Haskell) is a fantastic way to waste time on something that doesn't really matter.


Especially considering that most monad patterns (functions that create functions that create functions) tend to perform badly on platforms not designed for them, for example the JVM. A straight-line imperative function is going to perform way better than a function that has been split into 10 partially applied functions. @qqq


So it's a fun metal exercise...but how can it be justified trying to shoe-horn monads into Clojure when a bit of mutability here, and a few macros there would solve the problem in 5% of the time.


@qqq: You seem to think that JavaScript is something difficult to learn, that takes weeks or even months of study. It doesn't; it's a relatively trivial language that you can learn very quickly once you know a few more sophisticated languages. Someone familiar with Haskell looking at things like promises in JS knows almost immediately exactly why they're there, what problem they're solving and how they work. He'll also think, "they should just have used a monad for that."


After a program in clojurescript, I got a better feeling as javascript works and a quality of my JS code has improved by 10000% (Judged by me 😛 )


@cjs: I never claimed it was difficult to learn.


@cjs: If you're first language is C++, Java, or Haskell, you don't get to see how to immedaitely create cool apps in it.


@cjs: If your first language is JS, you can be building mini-pinterest, in your first quarter of college.


@qqq Sure, but if you're so uninterested in learning about comp. sci. that you need the distraction of playing around with web apps to keep you going at all, you should just drop out of the program (saving yourself a large pile of time and money) and just play with that stuff yourself or do a programming boot camp. What you're suggesting is akin to spending time teaching physics students how to build model rockets instead of physics theory.


@cjs I think JS is a difficult language in the sense that you need to understand its internal workings very well to avoid bugs or explain why unexpected things behave the way they do...


JS is the only language where I actually had to look through the formal ECMA spec to get something done.


@cjs: I bet you have more CS theory knowledge than the founders of SnapChat, but look at who has created more jobs / higher net worth.


and I believe teaching JS first will get more students to think about creating stuff like snapchat/ pinterest / / ...


@qqq: I am utterly mystified why you think university courses are a place to convince people they want to create startups or why they should be a place to teach that.


Elite universities are focused on creating the next generation of leaders.


Founders are part of that group of leaders.


Founders of tech. startups are usually leaders because they were successful at building a startup, and they're usually successful at that because they just went and did it rather than relying on some university to make them a leader. Bill Gates' little time at Harvard before he dropped out contributed negligably, if at all, to his success.


And having universities, elite or not, try to turn their students into code monkies is not going to help any of them become leaders.


@cjs: Teaching people JS does NOT turn them into code monkeys. It gives them the opportunity to build something new (and a chance to be a Founder/Leader if it takes off).


@cjs: (see above)


No, it does not, primarily because to build anything non-trivial will require them to build systems that JS simply would not equip them to think about properly.


Not by default, not without some painful stretching of the language.


He is also assuming everyone wants to build a startup. Not everyone who goes into CS wants to build a startup.


And learning a little bit of Business Admin/Marketing would be more helpful to those who want to build a business. Learning JS does not make them a business guru.


I studied cs because I am interested in how things work, in the basics and concepts behind all the superficial stuff. Programming languages are just a small part of it. If I wanted to start a business I would rather have studied economics or marketing probably and not some STEM stuff.


> [Computer science] is not really about computers -- and it's not about computers in the same sense that physics is not really about particle accelerators, and biology is not about microscopes and Petri dishes...and geometry isn't really about using surveying instruments. Now the reason that we think computer science is about computers is pretty much the same reason that the Egyptians thought geometry was about surveying instruments: when some field is just getting started and you don't really understand it very well, it's very easy to confuse the essence of what you're doing with the tools that you use."


@dominicm one of my absolute favorite quotes from SICP


@roberto : I'm not assuming everyone who goes into CS wants to build a startup. I am stating that, from a University's perspective, cranking out successful Founders makes the University more prestigious.


@fellshard : I completely agree that JS-first is not a good way to design systems that scales to millions of requests / second. However, by the time the JS-first student reaches that point, he/she has enough users to raise VC and hire professionals.


And yet we have a startup industry full of those who I daresay I'd label JS jocks. 😛


The presumption that JS devs will simply 'grow out of development' seems patently incorrect.


that is not the really CS. If they want to rush things to build a business, a trade school is the right place for them (and also get a degree in Business and/or Marketing)


@fellshard : I'm not talking about "JS Devs", I'm talking about Founders who merely use JS to write their first prototype to find a new niche, who then raises VC, becomes CEO, and hires professionals.


Professionals who also write in JS.


The popularity of JS in recent years alone speaks to that, despite it being practically unused beyond basic web dev in any organization larger than a startup.


I'm not sure if we are even debating the same issue anymore, or just flinging facts. 🙂 To clarify, here is my argument: 1) Producing students who go on to to Found successful companies increases the prestiege of an University. 2) A lot of modern web startup is NOT about some fundamental tech breakthrough; but just flinging mud at a wall until something sticks. 3) Teaching JS first allows first year students to try random social experiemnts that may or may not become the next Pinterest / Facebook / Snapchat. 4) Thus, teaching JS first makes sense for Universities.


But none of that requires a university


yeah, I disagree with all those points.


@tbaldridge : but that is the question of "should founders go to University"; not "should Universities teach JS in first year"


And for that matter the vast majority of developers I know don't have any formal training on software engineering at all.


But yes I agree, it's OT from your statement.


Personally, I love Scheme/SICP; but if a University is trying to maximize it's prestiege by producing maximal # of successful startups, JS seems like an excelltent choice.


But on-topic, I have yet to see anyone go from knowing nothing about programming to writing some awesome startup 4 years of training later.


Maximal successful startups is completely orthogonal to the language chosen.


Facebook was starte with PHP. Snapchat was written in Python and Java. Pintrest is Python....none of that says we should be teaching JS.


Let alone that if you have serious server work to do you're going to need something besides Node.JS.


(e.g. you're not going to do facial recognition in pure JS)


Youd' probably get started not by writing your own tensorflow / gpu routines, but by usting GOogle/Amazon computer vision services.


maybe, but a JS course at a university isn't going to teach you that. Let alone that any JS stuff you learn will all be different by the time you leave the uni. It's better to teach students proper software design, and comp-sci that will help them understand the reasons "why" we program a certain way, not the "how".


It's like any profession...teaching someone the "how" just turns them into cargo-cult-ers. Better to teach them the "why" so they can go and teach themselves the rest.


@qqq you are also mistaken in thinking that the prestige of a university has anything to do with tech founders having been associated with it. That's just plain wrong. Prestige of a university is pretty much solely based (for good or bad) on whether it produces top notch research and thereby also attracts top notch researchers.


The one thing universities are good at is their ability to make brilliant people meet each other. When brilliant people meet, they make great things together. I'm not sure universities will attract as much brilliant people if they follow the path of hype


@qqq the other day you compared clojure to a totalitarian socialist economy, and called erlang capitalist. It led me to wonder what an actual capitalist runtime environment would look like. For example, you would need a scheduler that allocated runtime resources in proportion to the resources you have already claimed (even erlang is socialist in that resources go back to a communal pool and can’t be reserved for the children of their owners).


@jsa-aerial: I agree that there are different forms of prestiege, and that research prestiege is based on research output, not founder output.


@noisesmith: this was in the context of actor model / objects / messaging (stuff talking to each other on its own) vs top-down control of managing all the objects right?


as I say, for a university there really is only one form of prestige and it isn't anything about founders of companies


@jsa-aerial: If we look at the two extremes, I would argue that in the eyes of many students, YC (pure startups, no research) is more prestigious than pure research centers (that produce research appers but not startups).


students don't care about that


@noisesmith : perhaps 'capitalist' was a bad choice of words; I wasn't referring to actors "producing more output than the resources they use" -- but rather, objects decide when to talk to each other ; rather than a top down control to get stuff to talk to each other


people who want to study CS don’t care about founders and YC and all of that


let's call truce on this; I think we're spamming #off-topic, and neither of us will convince the other of anything 🙂


seriously, I work at a uni in research and none of the students there care one bit about what you are saying they do/should


you are better off doing a major in information systems and a minor in business admin if you care more about the business side


So here's my beef...I don't care....because at the end of the day 99% of startups die, or are acquired by some company then killed. It's a tech bubble that will pop (horribly) in the next 10 years. You can't keep lighting money on fire and expect everything to go well long-term. At some point investors will catch on, that most "disruption" tech is just a 20-something kid who doesn't understand the problem space.


We even see that today with Uber...turns out, once you start paying people decent wages, and stop paying your customers for using your service, and start doing better have to charge the same amount as a normal Taxi company. And the whole thing falls apart.


Do Universities not leave the education targeted at "practical" to trade schools? Admittedly, I've read that universities are being pushed towards being trade schools in computer science department.


Disrupting also usually just is a term for "getting as much capital as one can, bid much lower than the competitors, try to wait until competitors fall apart, monopolize the business". So its not about being better in terms of economics, treating workers or anything, but just about moving as much money to yourself as possible when you have a monopolized business space.


They used to - and for the most part, the 'prestigious' ones still do that. But, as you mention, there is definitely a push at being a trade school competitor for some of this.


There seems to be alot of animosity towards SV style startups here. 🙂


For me personally its more of animosity towards capitalism in general


Well for me it comes down to a certain amount of insolence is the idea of "disruptive tech". The idea being: "I'm a person who understands don't, let me show you how computers can change how you work". That's all well and good, but the problem is there's little recognition that the programmer may not understand the problem space at all. Disruptive tech boils down to: "let me tell you how to do your job". Sometimes a industry needs that, or sometimes it doesn't matter. If you screw up and delete 50TB of cat photos, big deal. However, what about if you screw up your "disruptive" medical tech and people die?


Or like Soylent...end up giving a ton of people food poisoning.


SV “disruptive tech” is a joke. It is just insolent kids with silly ideas getting loads of money to screw up the world.


“disruptive tech” would be SV solving the water crisis in flint. It would have way more impact than self driving cars.


The problem with solving the water crisis in flint is that there is only money to be spent and none to be earned. Thats why no one with money is interested in that^^


right, the incentives are wrong.


so …. be “disruptive” then….. isn’t SV so smart?


Exactly, if you spin this further, it would not be disruptive tech, but tech that benefits human beings which is not the goal of capitalism as capitalism values money and not healthy humans.


Milton Friedman would argue that it's precisely selfish Capitalism that ends up producing the best living conditions for all involved.


What we have today in the US is not capitalism, but crony capitalism. Things like patents, lobbying, etc. stifle innovation and competition.


And now we descend into politics...and that's hard, so I'm going to go back to the easy stuff and do some programming.


Seems like there's a lot of good points on both sides of the "js as a first language" debate. Maybe the answer is "you should learn 'theoretical' languages like Scheme and 'practical' languages like Javascript as early as possible." Maybe all novice programmers should be trained polyglots from the jump.


john: my advice to noobs is always "spend a few months studying assembler and Scheme, at the same time. once you've got the basics of those 2 you can easily pick up any other language. nobody ever takes that advice, i dunno why.


So much of this. Much like someone raised in a bilingual environment tends to learn new languages much more quickly, learning and holding seemingly conflicting models of computing through different languages will help shape these devs for future application of those principles, whether they realize it at the time or not.


Seems like language skill has to do with knowledge of the syntax and some idiosyncratic semantics of said language. Whereas comp-sci knowledge or wisdom has more to do with the semantics that are general to all computing languages, such as the big O notation characteristics of certain idioms, regardless of the underlying language.


and what separates a novice from an expert comp sci professional is knowing those trans-language constraints on general algorithms, regardless of the language.


But Lisp has an objective, qualitative impact here. Because of the simplicity of the syntax, the semantics of the idioms become much more obvious, at least to my eyes.


As such, there are lots of aspects of comp sci that I simply didn't understand until learning Clojure


yup. imagine having to write Turing Machine code.


It's part of why people swear by SICP.


the other thing is that lisps are not just "better" versions of ealier languages, the way e.g. Python is better than COBOL, but of the same family. The primitives of a lispy language are genuine computational primitives.


Exactly. And lisp syntax is simple enough that my little brain can actually see those computational primitives. Whereas people with larger brains are able to see them through all the ceremony of OOP in Java, which I cannot.


Which is why I don't understand the "steep learning curve" argument about Clojure. It was the smallest learning curve of any language I've tried, for me.


and they compose! woot!


ah, but clojure has some twists, most obviously laziness, but also some non-obvious typing wierdness.


e.g. contains? is a little counter-intuitive.


It's got default conventions sometimes that aren't what learners expect, but make sense as soon as you plug it into common contexts.


Things like next vs rest.


More than any other language, Clojure seemed to follow the rule of 'that just works', due to that extreme composability. "This function describes that it works like this. Does it do X I expect it to? Yup. Does it do Y that I expect? That seems like common sense... yep, it does. Nice."


Yeah, it'd have caused less dissonance too if seq operations returned coll types of the kind they were handed. Not sure how much more complex that implementation would be though, if even possible for arbitrary collection types.


which means: getting started with clojure is pretty smooth, but real mastery is pretty much the same as any other language: lots of time and pain. but the rewards are better.


hmmm, I thought all CS students were trained polyglots.


Or just use Clojure, and operate over Java and JS at the same time 😉


I remember learning C, assembly language, C++, Java, perl at Univeristy


Assembler, C, bash, Java and Haskell here 🙂


Although I have to add, I was at a very database oriented university and we had a lot of courses about them


I wonder what would happen if schools spent time teaching categories of languages. Assember/C, Java, Haskell, Prolog, Scheme


PL/I, FORTRAN, Assembler. This was a while ago 😉


IMHO C to undersand computer-specific problems (pointers, buffers, memory) javascritp/java to understand the "real world" lisp to anything else


Everyone deterred me from C when I was trying to learn to program. When I just read the K&R book, I got programming, and felt pretty comfortable writing code.


C is great because it is small. Sure it's dangerous. But if you know it, you know the foundation for languages such as PHP, Javascript and Java. You won't have too much problem upskilling onto them.


personally I really don't like working in C.... sure the language itself is great but the culture is just not right for me, I can never understand what those damn abbriviations mean when all the library authors decide to name their things with the least characters possible and documentations are just autogenerated with zero explaination (if they even exist)....


That's more an ecosystem than language problem, but yeah.


My first language was assembler since I came from an electronics background and thought programming languages were scary..... and boy am I glad I learned everything from the bottom up 🙂


and to this day I still find compilers magical, assembler is the only "language" I'd claim to fully understand.


@akiroz what's awesome is when you realize that even assembly is a high-level language over microcode, that's executed by a JIT in the CPU.


oh yeah, modern CPUs are whole different beasts compared to what I used back then 😛


I can't even begin to comprehend how the neural-network branch predictor works in the new AMD Ryzen CPUs.....


even more awesome is the realization that you've learned a model of conputation, and that lambda calc and Turing Machines are completely different models.


and then you discover that interactive computing requires a while 'nother model and your head explodes.


Which boils down to learning for all your life which is why it just doesnt matter which language you learn first or second or third in CS. I think its way more important to get a side job as soon as possible, to see some real world problems and code.


I always see myself as someone that solves problems. And the tool to solve a problem is mostly dicated by the business you join after you are done with your degree. Hardly anyone will come to some fresh guy from university and ask him about the architecture of its system.


@tbaldridge if I want to write a new language and generate a "IR" on python "VM", there is a good pointo to start to study? (i'm diggin on pixie code but I'm lost)


a point in favor of js: i'll bet most students in the Intro class are not CS majors; they just want to learn a little programming, because they know some programmning skill is fast becoming a requirement in almost any field. that makes js or python a reasonable choice.


can’t they have a remedial course instead of inflicting damage on the CS majors?


and I think an intro to programming class should cover at least three paradigms, which might require using 3 different languages. For example: functional typed: SML, dynamic functional: clojure or racket, and oop : python or ruby. If people who just want a general knowledge about how to write a web site, and learn JS/html/css, then I think that is a different course. Not sure that belongs in a CS course.


my guess is lots of schools have an Intro for CS Majors, or an Honors Intro or similar that covers this.


@souenzzo two things are your friend there, look into a python library called byteplay or a similar bytecode assembler module. From there I recommend digging into the dis module. If you call dis.dis(myfunc) from a Python repl it will dump the bytecode from the function


it's fairly easy to reverse engineer from there.


Also, you can introspect all the aspects of a funct/code object in python via dir. I learned a lot by comparing the properties of those objects with the output of dis.


the Python bytecode interpreter is quite elegant, even if it does make several odd design decisions.


Like mutable closures..... (facepalm)


There days I findout how clojure #'vars works the differences between call (#'var x) or (@#'var x).... just awesome implementation...


I just remembered why: it had it's own vm