Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Breakfast All Day
Oct 21, 2004

review changes to your languages keywords and fundamental types during your daily scrum

Adbot
ADBOT LOVES YOU

Notorious b.s.d.
Jan 25, 2003

by Reene
roger corman's lisp for win32, corman lisp, went open source today

it is somewhat bitrotten but it is still a cool artifact of a time when people still had hopes and dreams for common lisp

https://github.com/sharplispers/cormanlisp/

i was never a win32 guy but supposedly this was a really great implementation of CL on win32 if that's your bag

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

sarehu posted:

Did Rust really just officially decide to get rid of pointer-sized int/uint shortly after officially deciding to keep pointer-sized int/uint?

yep. they are killing int/uint completely and will never have a default integer type; you will have to pick i32, i64, or isize yourself depending on use. apparently 64-bit integers just have cripplingly bad performance because of the extra cache usage, even on 64-bit machines; this means that there's no acceptable default type, but you would expect int to be that type, and so there should not be an int. (this last bit is actually good reasoning. the performance argument is dumb, though)

triple sulk
Sep 17, 2014



sarehu posted:

Did Rust really just officially decide to get rid of pointer-sized int/uint shortly after officially deciding to keep pointer-sized int/uint?

Any time you get confused about rapid changes or odd decision-making just remember that Ruby programmers are working on it

compuserved
Mar 20, 2006

Nap Ghost

triple sulk posted:

Any time you get confused about rapid changes or odd decision-making just remember that Ruby programmers are working on it

ruby seems like a really bad language; why do people choose to use it?

edit: granted I am a bad programmer and am not really experienced enough to call any language good or bad, but many of the more knowledgable posters dislike ruby and that's good enough for me. I just don't understand why people would start using ruby in the first place when more mature, and arguably better languages already exist.

compuserved fucked around with this message at 05:30 on Jan 6, 2015

Notorious b.s.d.
Jan 25, 2003

by Reene

compuserved posted:

ruby seems like a really bad language; why do people choose to use it?

edit: granted I am a bad programmer and am not really experienced enough to call any language good or bad, but many of the more knowledgable posters dislike ruby and that's good enough for me. I just don't understand why people would start using ruby in the first place when more mature, and arguably better languages already exist.

rails.

Notorious b.s.d.
Jan 25, 2003

by Reene
also scripting

python, ruby, and perl are all really great for replacing shell scripts while you do horrible sysadmin tasks

compuserved
Mar 20, 2006

Nap Ghost

lmao, what a surprise that trains are involved

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

compuserved posted:

lmao, what a surprise that trains are involved

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Notorious b.s.d. posted:

also scripting

python, ruby, and perl are all really great for replacing shell scripts while you do horrible sysadmin tasks

haskell's good at this too

tef
May 30, 2004

-> some l-system crap ->

rjmccall posted:

rust is really interesting to me because it stakes out a philosophical position on ownership and commits to it really, really hard. rust has unique ownership and borrowing, and if you aren't using them correctly you are Doing It Wrong and should feel bad. it is a huge imposition on users, and rust's answer is basically "look, you need to trust us, it's worth it if you get this right". and rust has committed to this on the back of basically an academic argument and very little practical experience with its consequences. there are an awful lot of practices and idioms based on implicit (usually temporary) shared ownership that have to be rethought to work under the rust model

i'm not saying this to bash rust, i think shared ownership is problematic and unique ownership tracking is legitimately important and that rust has a pretty well-thought-out approach for addressing these problems, especially now that they're using reasonable default annotations. rust has the courage to build their castle on a hill and say "this is the best hill and you should live in our castle" purely because they've dug down and found good bedrock. it's just that, oh man, this is an awfully steep hill, and the closest water is that river down in the valley, where the road passes through the town and there's a good market most days, and i'm pretty sure you could find somewhere to build a pretty good castle down there which would protect people without making them climb up and down the hill every day just to take a drink


it doesn't commit to it, it forces the user to commit to it pretty hard.

rotor
Jun 11, 2001

classic case of pineapple on pizzadog derangement syndrome

fart simpson posted:

haskell's good at this too

so is node and basically anything else that isn't compiled

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

tef posted:

it doesn't commit to it, it forces the user to commit to it pretty hard.

thank you for your insight, i will apply your editorial suggestions to the second draft of my white paper

tef
May 30, 2004

-> some l-system crap ->

rjmccall posted:

thank you for your insight, i will apply your editorial suggestions to the second draft of my white paper

np, happy to digest everything into pull quotes

leftist heap
Feb 28, 2013

Fun Shoe
ah yes, haskell for scripting. let's use the language that had to invent its own make believe math for IO in order to do scripting. lmbo.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

rrrrrrrrrrrt posted:

ah yes, haskell for scripting. let's use the language that had to invent its own make believe math for IO in order to do scripting. lmbo.

i use it all the time for little scripts that i used to do in python. it works well and is much more pleasant to write

b0lt
Apr 29, 2005

rjmccall posted:

yep. they are killing int/uint completely and will never have a default integer type; you will have to pick i32, i64, or isize yourself depending on use. apparently 64-bit integers just have cripplingly bad performance because of the extra cache usage, even on 64-bit machines; this means that there's no acceptable default type, but you would expect int to be that type, and so there should not be an int. (this last bit is actually good reasoning. the performance argument is dumb, though)

this is a good thing if it means people use size_t, ptrdiff_t, uintptr_t (or renamed equivalents)

this is a bad thing if there's also ssize_t, intptr_t, and other worthless typedefs (edit: how could i forget off64_t) floating around to confuse things

also, how are they going to reconcile this with foreign interfaces (posix, etc.) that explicitly use 'int'? force the user to manually do their own typedef for int matching the abi?

b0lt fucked around with this message at 08:49 on Jan 6, 2015

cowboy beepboop
Feb 24, 2001

isize and usize or something

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

b0lt posted:

also, how are they going to reconcile this with foreign interfaces (posix, etc.) that explicitly use 'int'? force the user to manually do their own typedef for int matching the abi?

rust int didn't match c int anyway. no major platforms use a 64-bit c int. someone actually brought this up as a reason to use a fixed 32-bit int, and then somebody else pointed out that c's int was allowed to be as small as 16 bits (and often is in embedded systems)

i suspect that this decision has a lot of ramifications for c interaction / portability / language evolution that they haven't really thought out, but it kindof depends on details about how they handle integer conversions that i won't pretend to know

Vanadium
Jan 8, 2005

They have aliases for a lot of C integer types so for C FFI you just use libc::c_int instead, and hope you don't overflow inbetween conversions or whatever.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
too bad clay never gained any traction *sighs wistfully*

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
afaik, clay pretty much died when we stole joe groff

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
thanks, hitler

Soricidus
Oct 21, 2010
freedom-hating statist shill

Blotto Skorzany posted:

thanks, hitler

np

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

fart simpson posted:

i use it all the time for little scripts that i used to do in python. it works well and is much more pleasant to write

I know some haskell and it has some cool stuff but I can't see it being nicer than python at scripting

if you want an example to sell me here's a script for counting words in files. the biggest feature for me over whatever bash script thing is that it doesn't explode when it sees non-ASCII characters.

Flat Daddy
Dec 3, 2014

by Nyc_Tattoo
im not a professional haskeller so theres probably some sick 1 liner version thats just >>='s and .'s and $'s and library functions that i dont know but

code:
import Data.Char
import Data.List
import qualified Data.Map as M

countWords = foldr counter M.empty
  where counter word map =
          M.insert word (1 + M.findWithDefault 0 word map) map

showCounts counts =
  let lines = map showLine (M.toList counts)
      showLine (word,count) = (show count) ++ " " ++ word
  in intercalate "\n" lines

main = do
  file <- getContents
  let listOfWords = words ((map toLower) file)
  putStrLn (showCounts (countWords listOfWords))

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Flat Daddy posted:

im not a professional haskeller so theres probably some sick 1 liner version thats just >>='s and .'s and $'s and library functions that i dont know but

code:
import Data.Char
import Data.List
import qualified Data.Map as M

countWords = foldr counter M.empty
  where counter word map =
          M.insert word (1 + M.findWithDefault 0 word map) map

showCounts counts =
  let lines = map showLine (M.toList counts)
      showLine (word,count) = (show count) ++ " " ++ word
  in intercalate "\n" lines

main = do
  file <- getContents
  let listOfWords = words ((map toLower) file)
  putStrLn (showCounts (countWords listOfWords))

i might do it a similar way, although i think you're missing the feature where it prints out the most common words first. i'd add that by changing yours to:

code:
import Data.Char
import Data.List
import Data.Tuple
import qualified Data.Map as M

countWords = foldr counter M.empty
  where counter word map =
          M.insert word (1 + M.findWithDefault 0 word map) map

showCounts counts =
  let xs = map swap (M.toList counts)
      lines = map showLine (sortBy (flip compare) xs)
      showLine (count,word) = (show count) ++ " " ++ word
  in intercalate "\n" lines

main = do
  file <- getContents
  let listOfWords = words ((map toLower) file)
  putStrLn (showCounts (countWords listOfWords))

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Symbolic Butt posted:

I know some haskell and it has some cool stuff but I can't see it being nicer than python at scripting

if you want an example to sell me here's a script for counting words in files. the biggest feature for me over whatever bash script thing is that it doesn't explode when it sees non-ASCII characters.

convert me back to python. this is a slightly simplified version of a thing i wrote recently to hook itunes into an automation system. the main features for me are it handles concurrent connections and keeps the connection alive and keeps accepting commands without dropping the connection after each received command. i initially tried to do this on python and there seemed to be a lot less explicit and a little more complex, and it was dropping the connection after each command and the obvious thing to keep it alive didn't seem to work

code:
import Network
import Control.Concurrent
import System.IO
import System.Process

main = withSocketsDo $ do
    sock <- listenOn $ PortNumber 1234
    loop sock

loop sock = do
    (h,_,_) <- accept sock
    forkIO $ handler h
    loop sock
    where
        handler h = do
            cmd <- hGetLine h
            reply <- handle cmd
            hPutStrLn h reply
            handler h

cmdList = ["play", "pause", "stop"]

handle :: String -> IO String
handle cmd = if cmd `elem` cmdList
    then osascript cmd >> return "success!"
    else return "invalid command"
    where
        osascript s = system $ "osascript -e 'tell application \"iTunes\" to " ++ s ++ "'"
e: another feature is i made a typo when writing this and the compiler told me immediately instead of having to actually run the thing and get to that point in the code to find out

fart simpson fucked around with this message at 05:16 on Jan 7, 2015

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
Really wish I had an excuse to do haskell

leftist heap
Feb 28, 2013

Fun Shoe
actually the more i think about it the more i think haskell is probably better at scripts than programming in the large.

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine

MALE SHOEGAZE posted:

Really wish I had an excuse to do haskell

same, op

Crosscontaminant
Jan 18, 2007

rjmccall posted:

yep. they are killing int/uint completely and will never have a default integer type; you will have to pick i32, i64, or isize yourself depending on use. apparently
aiui doing `let x = 3` will pick i32 unless you typehint it otherwise. the main impetus behind getting rid of int/uint is they look like default integer types for when you don't really care about size, which is bad because a) they're not default integer types (they're for sizes and offsets, which is what isize/usize are for - the default integer types are i8, u8, i16 etc) and b) you should always care about size (if you want no upper bound, use a bigint of some kind)

Vanadium
Jan 8, 2005

Bigints are gonna suck because you're gonna have to write like &x + &y if you don't want x and y to be consumed by the addition

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band
anybody got strong opinions about "seven languages in seven weeks"? https://pragprog.com/book/btlang/seven-languages-in-seven-weeks

looks like it could be interesting/fun/educational

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
anything put out by pragprog is guilty until proven innocent in my book

tef
May 30, 2004

-> some l-system crap ->

prefect posted:

anybody got strong opinions about "seven languages in seven weeks"? https://pragprog.com/book/btlang/seven-languages-in-seven-weeks

looks like it could be interesting/fun/educational

it does look like that, but really, it will be seven tutorials stapled together. if you need a guiderail to push yourself into new languages, i guess it's cheaper than buying seven books, but a lot of what makes the book is going to be very introductory material. i've only given it a skim but my assumption seems to hold reasonably well from what i saw

you'll get an introduction: getting the platform, running some hello world like code, a few larger exercises, but you won't really dig into what makes the language tick until you write something more complex

really you could just spend the time picking up one language for a while, and then pick another. you'll learn more and there is plenty of time to do it.


Blotto Skorzany posted:

anything put out by pragprog is guilty until proven innocent in my book

same.


digging into the book

Ruby — You'll probably get a taste but it has taken me months to understand why ruby and why code ends up looking that way
Io — This is a toy language that never really saw much exposure outside of the Ruby/HN crowd.
Prolog — This covers the very basics of prolog but nothing that will make it click. This is quite hard to do in a chapter.
Scala — By the time you read this scala has probably changed sufficiently to make this dated.
Erlang—Read Joe Armstrongs thesis instead.
Clojure—Watch a Rich Hickey talk
Haskell—Learn you a haskell online

We have: class based smalltalk variant. protoype based smalltalk variant. logical programming language. class based java variant with functions and types. functional scripting language with actor concurrency. a lisp bolted to the jvm with immutable datatypes and multiple dispatch.

i'd really ask what you're actually trying to achieve here, beyond maybe investing slightly more time in a language than just reading the wikipedia page :v:

i really don't like their typesetting and enjoyed my confirmation bias when it turned out i didn't like the copy much either

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

tef posted:

i'd really ask what you're actually trying to achieve here, beyond maybe investing slightly more time in a language than just reading the wikipedia page :v:

i'm not sure; it's going to be read by a book club, and i was wondering if i should join up, since it might be more motivating than trying to pick up new things in my spare time :shrug:

gonadic io
Feb 16, 2011

>>=

prefect posted:

i'm not sure; it's going to be read by a book club, and i was wondering if i should join up, since it might be more motivating than trying to pick up new things in my spare time :shrug:

go for it

UncleBlazer
Jan 27, 2011

It is just over 4 years old, can't speak for the content but a lot changes in that time. If you're going to read it just to open yourself up to new concepts then go for it.

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

prefect posted:

looks like it could be interesting/fun/educational

please fill in this form and i will recommend three languages to you to learn, and maybe some rough ideas of starter projects

A] what languages do you know and can you rate your confidence on a scale of 0-10

0 - i know it exists to
3. i've written hello world,
5. i can edit it with the manual open constantly
7. i have graduated from the manual to stackoverflow and google
10 - i could get paid to write in it

e.g ruby(7), python(10), C(5). the numbers are more to distinguish which ones you have spent more time using, rather than being a perfect total ordering

B] how much time will you spend learning a new language, roughly in terms of number of afternoons

C] Is this a hack "eh i'll hack for a bit but i'm not sure what i'd do with them" or an experiment "i have something to do but i wanna play in a new language" or neither

D] what sort of things do you want to learn in a new language

language features, for example: Actors/Concurrency, Alternate models of OO, immutability, higher order programming, type systems, fault tolerance, queries/pattern matching, etc

algorithmic things: machine learning, ocr, search, compression, transformation

coding skill: debugging, tracing, reverse engineering, documenting, analysis, design language, and formal approaches

toolkits or libraries: gui programming, data processing

E] any other constraints on time, area, interest, or otherwise

F] do you develop on linux, osx, windows or do you have a particular target in mind, like mobile or browser or desktop?

expect a response in a day or so i might need to think about it

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply