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
VikingofRock
Aug 24, 2008




if I were concerned about performance why would I be using python?

Adbot
ADBOT LOVES YOU

VikingofRock
Aug 24, 2008




Honestly I think that having more ways of doing something usually makes a language richer and more expressive, and I would much rather have many ways of doing something than be forced into something clunky because the natural way isn't "pythonic" or something.


Also C++ has its warts but it is a much, much, much, much, much better-designed language than javascript.

VikingofRock
Aug 24, 2008




MALE SHOEGAZE posted:

Hm, yes, the design of a language designed to be compiled using a relatively straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal run-time support, can be meaningfully compared to

meh I think you can compare the overall design of two languages even if they were designed to do different things. the post I was responding to said that C++ suffers from poor design and feature bloat, and I while you can make a case for both it's pretty ridiculous to imply that c++'s design is bad on the level of js.

VikingofRock
Aug 24, 2008




fart simpson posted:

i used to like python and then i figured out haskell is way better

the truth

VikingofRock
Aug 24, 2008




MeruFM posted:

I did not imply what you think I implied. Using multiple examples does not imply complete equivalence

my bad then nvm

VikingofRock
Aug 24, 2008




Shy posted:

tcl looks fun but I've never seen anyone actually use it

I've used it at work! There is a very popular x-ray spectrum analysis tool whose scripting must be done in tcl for some reason.

edit:

Arcsech posted:

it is not fun

VikingofRock fucked around with this message at 19:53 on Jan 22, 2015

VikingofRock
Aug 24, 2008




Deacon of Delicious posted:

maybe you should do something important instead, like warn them about 9/11

Yeah thank goodness we sent back john titor instead!

VikingofRock
Aug 24, 2008




idk I like monads

VikingofRock
Aug 24, 2008




Ploft-shell crab posted:

monads is context with values inside

VikingofRock
Aug 24, 2008




Mr Dog posted:

I thought we were talking about Perl, not neoliberal economic policy

:eyepop:

VikingofRock
Aug 24, 2008




Is it still cool to complain about Java's weird OOP fanaticism? Because that's what strikes me whenever I look at Java code.

VikingofRock
Aug 24, 2008




ahmeni posted:

General Bit Shift is thataway >>

VikingofRock
Aug 24, 2008




HappyHippo posted:

point free rules

:agreed:

VikingofRock
Aug 24, 2008




wait why doesn't swift have namespaces?

VikingofRock
Aug 24, 2008




rrrrrrrrrrrt posted:

i have absolutely no idea what purpose duck typing serves in a language

VikingofRock
Aug 24, 2008




I don't really understand all the hate for C++'s streams. Is it just that they are not typechecked or is there more?

VikingofRock
Aug 24, 2008




HappyHippo posted:

when was the last time you got burned by a printf type error? how much time did it take to track down and fix?

agreed, no one ever gets bitten by printf errors

VikingofRock
Aug 24, 2008




b0lt posted:

i'm pretty sure that literally every single compiler has a non-constant format string warning, and if you're compiling without -Wall -Werror or equivalent you deserve what you get

sure, they aren't common anymore but they definitely still happen

VikingofRock
Aug 24, 2008




yeah you definitely want at least -Wall -Wextra (and probably -Wpedantic). Of course none of those contain -Wformat-security. :shrug:

VikingofRock
Aug 24, 2008




bobbilljim posted:

shipping source code to customers :S

I know this forum likes to shaggar about "open sores" or whatever but this is not an uncommon thing to do?

VikingofRock
Aug 24, 2008




Notorious b.s.d. posted:

"users" should not be compiling anything

lol if you've never built something from source

VikingofRock
Aug 24, 2008




fleshweasel posted:

no generic types was an incredibly loving stupid decision

VikingofRock
Aug 24, 2008




bobbilljim posted:

dynamic typing is great for single developer tiny scripts that you will only ever run once

IMO this is the only thing languages like python should be used for


Plorkyeran posted:

just yesterday i fixed a bug in code with 100% path coverage which would have been prevented by rust's type system, but which even having fixed it i had no idea how i could possibly write a test which would trigger it

This sounds pretty interesting--can you share any more details?

VikingofRock
Aug 24, 2008




Notorious b.s.d. posted:

good languages are equally effective for your one-off scripts and your multi-year software projects

i unironically write scripts in scala. it supports shebang notation and everything

a friend of a friend does all his one-off sysadmin scripts in ocaml. he works in one of the world's only ocaml shops, so it makes a lot of sense in his context. why use a second language for scripting if your first one will do ?

I didn't mean to imply that good langs shouldn't be used for short scripts. I actually started semi-seriously learning haskell after I saw someone in this thread post some of their haskell CJ scripts.

VikingofRock
Aug 24, 2008




comedyblissoption posted:

i think python is great for teaching imperative programming

but the only problem is it is actively hostile toward functional programming concepts like recursion and folds so I feel like students will come out with using mostly for loops for iteration except for some of the python collection syntactic sugar

I haven't really looked into either recursion or folds in python, but what makes it particularly hostile towards them?

VikingofRock
Aug 24, 2008




notorious do you think the . operator should be replaced with `compose`?

VikingofRock
Aug 24, 2008




Notorious b.s.d. posted:

i love the idea of haskell but there are so many obviously terrible ideas celebrated in that community, i can't fuckin bring myself to dive in

Notorious B.S.D. you should try Haskell. It's a really nice language and pretty much everything you have complained about in the past page is a sensible decision once you get around to using it. I understand why it wouldn't look that way at first glance though.

VikingofRock
Aug 24, 2008




EVGA Longoria posted:

what if i told you that words and names are a catalogue of symbols we've agreed on a meaning to?

whoa

VikingofRock
Aug 24, 2008




Athas posted:

I maintain a 23k+ SLOC Haskell codebase, and I don't think it defines a single infix operator.

While I mostly agree with not defining your own infix operators, I think they can sometimes be pretty nice. For example for the last parser I wrote I defined

code:

(<++>) a b = (++) <$> a <*> b

because I think

code:
parser1 <++> parser2 <++> parser3

is much more concise and every bit as readable as

code:

parser1 `listParserAppend` parser2 `listParserAppend` parser3

VikingofRock
Aug 24, 2008




FamDav posted:

why would you write listParserAppend when its over an applicative?

Yeah that was actually a pretty poorly-named function. In the context it was written, it takes two parsers-which-output-lists and joins them to create a single parser which outputs those lists concatenated (if both sub-parsers parse successfully), which is where I was coming from. But it should probably be called something like concatenateApplicative or something.

VikingofRock
Aug 24, 2008




Mr Dog posted:

The PL thread: Do you even lift

VikingofRock
Aug 24, 2008




CPColin posted:

Man, what even is the point of functional programming? Every time I see it, I think, "Way to go! You computed a value!"

I'm pretty sure that's what all programming does?

VikingofRock
Aug 24, 2008




CPColin posted:

In Java, I can make lots of things to click on.

Well yeah, but that's just your program (plus the OS I guess) computing values for the pixels on the screen, and then updating those computations with new information when you click on something.

VikingofRock
Aug 24, 2008




CPColin posted:

And with functional programming, you compute your one value and you're done. There aren't even any buttons to click on. What a silly thing.

http://en.wikipedia.org/wiki/Functional_reactive_programming

VikingofRock
Aug 24, 2008




Here's a cool article about the Option monad in Rust. It's nice seeing monads (and the clean code that they create) getting some play in imperative languages.

VikingofRock
Aug 24, 2008




Max Facetime posted:

just make ?. the default dereferencing operator for nullable values and make foo(object) and object.foo() mean the same thing

now you can simply write the thing you ACTUALLY want to write:

code:

fn get_user_with_shortest_name(names: Vec<&str>) -> User {
   names.get_shortest().find_user_by_name().json_to_user()
}


I agree, it'd be nice if things like Optional could define their own operators to make code using them less verbose and more readable. Personally I would call it >>= instead of ?. but both are good.

VikingofRock
Aug 24, 2008




Mr Dog posted:

why not #8==D instead

As an infix operator? I think the 'D' at the end would lead to parsing problems since it's a valid start of an identifier. That's why Haskell won't let you define that as an infix operator, anyways.

VikingofRock
Aug 24, 2008




gonadic io posted:

code:
Prelude> 5 &====> Just 3
Just 5
Prelude> 3 &====> Nothing
*** Exception: this has never happened before i swear

NICE!

VikingofRock
Aug 24, 2008




sarehu posted:

Rust has hit 1.0. Top post on the HN thread is a faux apology by some self-serving remora.

Discuss.

woohoo 1.0!

Adbot
ADBOT LOVES YOU

VikingofRock
Aug 24, 2008




Back on the topic of unary minus, my biggest Haskell pet peeve is the difference between map (+1) [1,2,3] and map (-1) [1,2,3].

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