[ art / civ / cult / cyb / diy / drg / feels / layer / lit / λ / q / r / sci / sec / tech / w / zzz ] archive provided by lainchan.jp

lainchan archive - /λ/ - 17540



File: 1469343711898.png (70.77 KB, 299x300, 1467780022399.jpg)

No.17540

Hey λainons, anyone else taking the Programming Languages by Dan Grossman MOOC? It's a second or third year course, so it's more meaty than most programming moocs and you'll probably learn something from it if you're self taught.

I've heard a lot of good things when it was offered some years ago, but sadly it didn't stay open like most moocs do. Anyways, it's a 3 part course that seems like the "survey of X civilization" in college, if you've taken one of those. It uses SML(static functional), Racket(dynamic functional), and Ruby(dynanamic OO), but It's more about the ideas of the paradigms rather than the languages themselves.

Either way, it's free, so if you're unsure just check out the intro video to see if it's something you'd like.
https://www.coursera.org/learn/programming-languages

  No.17541

Thanks for the heads up. I'm in the awkward self taught spot where I seemingly know how to make things/know some intermediate concepts but flounder sometimes with things that 'should' be simple.

  No.17542

>>17541
i know that feeling. i have that same problem with pretty much everything.

  No.17543

If I'm already comfortable with Scheme, OCaml and Smalltalk, is there any point in taking it?

  No.17551

>>17543
I don't think so.

I took it without knowledge of SML, but used CL and Ruby beforehand. It taught me a fair bit on the different paradigms and how they compare and contrast.

  No.17552

>>17540
thanks for the tip. coughed up some cash and now i'm ready to go.

  No.17662

Thanks mate. Imma enroll.


I've done the 600.6 of MIT half-thru only.

  No.17663

I just joined yesterday before seeing this thread.

I'm in much the same situation as >>17541 when it comes to self learning, hopefully this is a good jump into more intermediate topics. I have previously tried a course on algorithms that I think might be a bit above me, but this seems to be on a good level, I've only watched the first set of lectures, but he's skimming over basics that I already know and drawing attention to more interesting areas.

Hopefully we can talk about it and other courses in this thread, a lain classroom would be great.

  No.17696

Has anyone completed the homework yet for the first real week yet?
I'm not sure about the first challenge problem to implement some earlier functions in a way where duplicate input has no effect. The suggestion is to delete duplicate entries from the list and then use the existing functions, but I'm not sure how to do this using only the sml features that have been presented, other than using the obvious, but terrible O(n^2) algorithm.

  No.17730

I'm retarded, I don't get how the first `pow` function he shows actually works. It doesn't explicitly return an int, just keeps on calling itself until y is 0, so the fuck is this sorcery


fun pow(x: int, y: int) =
if y=0
then 1
else x * pow(x, y-1)

  No.17734

>>17730
Which language is this?

Regardless, it looks like the language has what are called implicit returns.

Notice that the recursion ends when y equals zero, which returns one. This propogates and completes the multiplications of x.

  No.17739

>>17730
I saw in the video that the ML doesnt have return functions, but you can imagine the evaluated expression as the returned value, if you wish.

  No.17747

>>17730
what >>17734 said but if you want to see it then write out an example calculation with pen and paper.

  No.17748

>>17730
SML has no statements, only expressions. The function's return value will be the value of the function's body.

  No.17823

File: 1470642047006.png (65.62 KB, 200x133, 1446261361782.jpg)

holy shit guys pattern matching is blowing my mind

Why don't more languages have this shit? holy fuck its so great

  No.17824

>>17823
It's glorious, but I feel like my understanding only scratches the surface of what this kind of thing is capable of.
The second set of homework questions has made me feel like an idiot all over again. I have no idea if nested patterns is the right way to solve the first few, supposedly basic, problems, but I'm lost for any other way.

  No.17840

>>17824
Mine did't use nested patterns but it did have cases going into another set of cases. I haven't turned it int so I'm not sure how the teacher solved it, so maybe his uses nested patterns and it's more

  No.17977

The graded assignments seem pretty pointless to me. I know you have to give a grade at the end of the day, particularly to those who have paid but the videos and summary notes are great on their own.

  No.18097

anyone else wowing themselves with their one line wonders on this last assignment?

  No.18116

>>17540
Had me till the language choices. SML? Man do Haskell man. Man.

  No.18122

>>18116
The languages were only chosen to better demonstrate certain aspects. SML is somewhat similar to Haskell and he even recommends Haskell at a few points, but explains that all the materials were already in SML. I was more annoyed when he mentioned that the Ruby part used to be in SmallTalk, I would have been interested to learn that.

>>17977
I think evaluating other people's code is a worthwhile venture and one of the better innovations of this course. It can be enlightening to see how someone else solved the same problems and knowing that others will see makes me pay more attention to keeping the presentation clean. It can be extremely annoying to do, but I think it's worth it in the long run.

  No.18123

>>18116
SML is simpler than Haskell and its syntax is very similar to OCaml, which is another great functional language. They probably chose it for the same reason why one would choose Scheme rather than, say, Common Lisp.

  No.18124

Did they announce when is part B and C coming out?

  No.18125

>>18124
Instructor said part B should be up a week or so after part A, and I'm assuming part C will come out after part B, too.

  No.18127

What's up with the locked homework, is that exclusive to subscribers?

  No.18128

>>18127
it unlocks after you turn it in. the locked homeworks are the the peer-graded versions of the ones you just turned in, so seeing other people's answers ruin it,and you need the answer sheet to see the examples of "good style" to grade for and that also ruins it.

  No.18129

>>18128
But the whole section is locked here, i can't see what the homework is, or does he explain that in the week 2 videos? I'm currently in the middle of it.

  No.18130

>>18129
Oh, this isn't one of the "always open" courses, which is why I posted it here so people would know about it before it closes. The sections close after the week is over, just like a normal college class.

  No.18131

>>18130
Well..that sorta sucks, i'll leave watching the videos for later then. Thanks for the info.

  No.18250

File: 1472294827271.png (11.44 KB, 132x200, tennis.jpg)

Who's signed up for part B then?

  No.18274

>>18250
OP here, I did. Just hope I can finish it in time, I'll be pretty busy the next few months and i'll be really bummed if I miss the homeworks.

I hope it's as enlightening as part A, but I guess since most of the "mind=blown" stuff was already covered it'll be a little less crazy.

  No.18464

Part B starts today, for those who are interested. I'm looking forward to playing around with languages in Racket.

  No.18792

this has been a really interesting two weeks so far. though the pace feels a lot faster than part A, the material feels meatier and a result I'm definitely feeling like I have less time than before. I'll admit I was having trouble getting my head around the parentheses but I'm getting a feel for things now and DrRacket is excellent.

  No.21737

File: 1485937545069.png (15.95 KB, 169x185, dan.jpg)

>>17734
It is SML (Standard ML) and it is the main language that the course is in.

>>17734
> Regardless, it looks like the language has what are called implicit returns.
It does, the moment is sees that it doesn't lead to another expression it will return.

>>17823
Most functional languages have a form of pattern matching. Haskell and Elm being prime example of this.

>>17824
>The second set of homework questions has made me feel like an idiot all over again. I have no idea if nested patterns is the right way to solve the first few, supposedly basic, problems, but I'm lost for any other way.
Homework in this course is really difficult and incredibly rewarding. Especially the second homework of part B will completely destroy you.

>>18116
He chose those languages for a particular reason. He explains them in the course but it boils down to the fact that they all showcase different ways of programming. He didn't think that Haskell was so radically different to alter the course so he didn't (he does recommend it for learning lazyness). Personally, I agree with this choice since SML is much simpler than Haskell.

>>18124
They come out whenever the last part is finished so you you can keep on learning.

>>18274
>I hope it's as enlightening as part A, but I guess since most of the "mind=blown" stuff was already covered it'll be a little less crazy.
I'm doing part C currently after taking a break and it is blowing my mind all over again. It is crazy.

>>18792
>this has been a really interesting two weeks so far. though the pace feels a lot faster than part A, the material feels meatier and a result I'm definitely feeling like I have less time than before. I'll admit I was having trouble getting my head around the parentheses but I'm getting a feel for things now and DrRacket is excellent.
>>18792
>this has been a really interesting two weeks so far. though the pace feels a lot faster than part A, the material feels meatier and a result I'm definitely feeling like I have less time than before. I'll admit I was having trouble getting my head around the parentheses but I'm getting a feel for things now and DrRacket is excellent.