mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Blogorrhea > jvang

Reply
 
Thread Tools
Old 2018-06-20, 10:39   #34
VictordeHolland
 
VictordeHolland's Avatar
 
"Victor de Hollander"
Aug 2011
the Netherlands

23·3·72 Posts
Default

Why not start with Java? At least that is what we started in my minor Computer Techniques (or what it was called, I studied Economics, which I didn't complete, but that is a story for another time).

Does Haskell have any big advantages over Java (I know Java is old and leaking security wise, but it is great for starting as it is platform independant).
VictordeHolland is offline   Reply With Quote
Old 2018-06-20, 15:08   #35
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

1,493 Posts
Default

Quote:
Originally Posted by VictordeHolland View Post
Does Haskell have any big advantages over Java (I know Java is old and leaking security wise, but it is great for starting as it is platform independant).
The built-in biginteger class in Java is much slower than Haskell's Integer, what is using gmp! It wasn't rare that Haskell was the fastest language from ~30 programming languages on a particular hard problem on a programming site.
R. Gerbicz is offline   Reply With Quote
Old 2018-06-20, 15:51   #36
xilman
Bamboozled!
 
xilman's Avatar
 
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

10,949 Posts
Default

When I find my code in tons of trouble,
Friends and colleagues come to me,
Speaking words of wisdom:
"Write in C."
As the deadline fast approaches,
And bugs are all that I can see,
Somewhere, someone whispers:
"Write in C."
Write in C, Write in C,
Write in C, oh, Write in C.
xilman is offline   Reply With Quote
Old 2018-06-20, 16:27   #37
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

23×17×73 Posts
Default

Quote:
Originally Posted by xilman View Post
Write in C.
Sí.

All the power, and all the safety features, of a chainsaw!

Last fiddled with by chalsall on 2018-06-20 at 16:30 Reason: Saw the opportunity for a joke....
chalsall is offline   Reply With Quote
Old 2018-06-20, 19:20   #38
jvang
veganjoy
 
jvang's Avatar
 
"Joey"
Nov 2015
Middle of Nowhere,AR

22×3×37 Posts
Default

Quote:
Originally Posted by Nick View Post
Is the Raspberry PI available in the US? It runs Linux too but makes it possible to play with the hardware as well as the software.
Of course; they're used very frequently in DIY projects and such! Someone did a Raspberry Pi supercomputer a while back, was pretty neat. If we need to mess with hardware we have 2 desktops sitting around with varying levels of quality (one is a custom-built monster, one is a starter kit from Wal-Mart with some of our spare upgrades).

Quote:
Originally Posted by VictordeHolland View Post
Why not start with Java? At least that is what we started in my minor Computer Techniques (or what it was called, I studied Economics, which I didn't complete, but that is a story for another time).
Tons of languages would certainly be more understandable/easier than Haskell, and be more applicable too. But it's better for me to take notes on something that no one we know knows; I have to take really good notes to figure it out. We choose to learn Haskell not because it is easy, but because it is hard

I think I might have figured out some basic stuff in Haskell. Calling a function is easy:

λ print "hello, world"
hello, world


And if I want to make my own function and call it:

λ let double x = x * 2
λ double 2
4


I can't use the online compiler at Haskell.org for that last one; I'm figuring out how to get the GHCi on my little Linux laptop so that I can. But I think that code will work
jvang is offline   Reply With Quote
Old 2018-06-20, 19:31   #39
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

233108 Posts
Default

Quote:
Originally Posted by jvang View Post
We choose to learn Haskell not because it is easy, but because it is hard
Paraphrasing John F. Kennedy about sending men to the moon before the end of the decade.

JFK didn't live to see this; his brains were blown out of his head (by a rile bullet shot from behind), and spattered all over his wife and his security detail....
chalsall is offline   Reply With Quote
Old 2018-06-20, 21:56   #40
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

23×17×73 Posts
Default

Quote:
Originally Posted by jvang View Post
And if I want to make my own function and call it:

λ let double x = x * 2
λ double 2
4
It would be a very primitive language which didn't let you define your own functions.

Things get rather interesting where you're allowed to "overload" the primitives. For example, with C++ et al you can define functions such that the + operator works differently depending on the parameters.

Last fiddled with by chalsall on 2018-06-20 at 21:58 Reason: s/than the/that the/; # Typing is hard....
chalsall is offline   Reply With Quote
Old 2018-06-21, 10:37   #41
xilman
Bamboozled!
 
xilman's Avatar
 
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across

1094910 Posts
Default

Quote:
Originally Posted by chalsall View Post
It would be a very primitive language which didn't let you define your own functions.
Some of which are well worth learning. Assembly languages are the obvious candidates, especially if you want to make your own programmable hardware.

Knitting patterns are another example.

Cookery recipes generally have the concept of functions ("first make a pint of white sauce") and, of course, you can define your own functions also called sub-recipes.

There's more to programming than digital computers ...
xilman is offline   Reply With Quote
Old 2018-06-21, 16:22   #42
jvang
veganjoy
 
jvang's Avatar
 
"Joey"
Nov 2015
Middle of Nowhere,AR

22×3×37 Posts
Default

Quote:
Originally Posted by chalsall View Post
Things get rather interesting where you're allowed to "overload" the primitives. For example, with C++ et al you can define functions such that the + operator works differently depending on the parameters.
Sounds complicated, but cool!

My dad showed me some simple apt- commands, like apt-get. I used apt-get update and apt-get upgrade to update all of my previously installed programs, then apt-get install to download some Debian references. Having a package manager is really helpful; why doesn't Windows have one of these by default?

Messed around with Haskell some more; my code in my last post works fine. And I can reuse it in another function as long as it's defined:

Prelude> quad x = double (double x)
Prelude> quad 2
8


Also messed with some basic string and list commands, like head, tail, putStrLn, and concat. concat is a little weird to use since you need a list:

Prelude> concat ["hello", " ", "world"]
hello, world


Hmmm. I think I'll keep using this for Bash commands and Fixedsys for Haskell GHCi commands.
jvang is offline   Reply With Quote
Old 2018-06-21, 22:09   #43
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

992810 Posts
Default

Quote:
Originally Posted by xilman View Post
There's more to programming than digital computers ...
Indeed.

In the construction industry the "Program" is the work to be done, and in what order. Critical path, etc.

It's a bit surprising how few foreman know how to read a Gantt chart....
chalsall is offline   Reply With Quote
Old 2018-06-22, 09:26   #44
Nick
 
Nick's Avatar
 
Dec 2012
The Netherlands

22·3·5·29 Posts
Default

Can you write a program which takes 2 sorted lists of numbers and merges them into a single sorted list?
For example, if we give it the lists [1,4,7,10] and [2,3,10,11], it would produce the list [1,2,3,4,7,10,10,11].
Nick is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Musings of someone learning airsquirrels Math 20 2018-12-29 18:15
Online language-learning course kladner Lounge 8 2013-04-18 03:08
Learning Python - Course from Google Jeff Gilchrist Programming 3 2012-01-15 00:29
flowcharts, self-learning jasong jasong 6 2007-12-07 14:06
Learning About RAM the Hard Way Longshot Hardware 5 2005-05-21 16:40

All times are UTC. The time now is 03:08.


Sun Oct 17 03:08:07 UTC 2021 up 85 days, 21:37, 0 users, load averages: 1.36, 1.15, 1.50

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.