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
gonadic io
Feb 16, 2011

>>=

syntaxrigger posted:

just curious

do you have a favorite language?

it's python iirc

Adbot
ADBOT LOVES YOU

suffix
Jul 27, 2013

Wheeee!

tef posted:

on reflection, i think i hate ruby more than any other programming language, past or future

a nice ruby feature is implicit returns + no type signatures + no static type checking so you can be looking at a function definition and have no clue whether it returns a value and whether it was intended to

JewKiller 3000
Nov 28, 2006

by Lowtax

AlsoD posted:

it's python iirc

i find it hard to believe that tef would be so myopic as to have one p-lang for his favorite language and another nearly indistinguishable p-lang for his least-favorite language

brap
Aug 23, 2004

Grimey Drawer

suffix posted:

a nice ruby feature is implicit returns + no type signatures + no static type checking so you can be looking at a function definition and have no clue whether it returns a value and whether it was intended to

is there anything that even makes this language better than say javascript

Sapozhnik
Jan 2, 2005

Nap Ghost
Python having mandatory type signatures on functions would probably make me seriously re-examine Python as a language I'd want to use, because then that means the type of every expression can be known at compile time and you can get tooltips and autocomplete dropdowns n poo poo. I guess forcing the programmer to declare the type of their local variables isn't super necessary because they can always just glom those variable values together into some monster expression and even the most type-nazi static languages out there don't make you declare the type of every single subexpression down to the atoms.

I don't like the philosophy behind plangs but if I were to accept that philosophy then I'd say Python 3 is by far the best plang, simply because the language is simple and therefore, crucially, predictable, and the community doesn't encourage the same sort of obfuscated wankery that the Ruby community seems to adore.

"hey bob what does this function do?" "who the gently caress knows, run it and find out!"

ShadowHawk
Jun 25, 2000

CERTIFIED PRE OWNED TESLA OWNER

Mr Dog posted:

Python having mandatory type signatures on functions would probably make me seriously re-examine Python as a language I'd want to use, because then that means the type of every expression can be known at compile time and you can get tooltips and autocomplete dropdowns n poo poo. I guess forcing the programmer to declare the type of their local variables isn't super necessary because they can always just glom those variable values together into some monster expression and even the most type-nazi static languages out there don't make you declare the type of every single subexpression down to the atoms.

I don't like the philosophy behind plangs but if I were to accept that philosophy then I'd say Python 3 is by far the best plang, simply because the language is simple and therefore, crucially, predictable, and the community doesn't encourage the same sort of obfuscated wankery that the Ruby community seems to adore.

"hey bob what does this function do?" "who the gently caress knows, run it and find out!"
You can basically do this right now if you have social control over the coding standards and can force your peers to annotate their functions (and then use either one of the linters or runtime-type-enforcing libraries)

Sapozhnik
Jan 2, 2005

Nap Ghost
my philosophy, as opposed to the plang philosophy, is this: "there are two kinds of software projects: failures, and legacy code".

iow if your software ends up being useful to anybody then it's going to spend most of its time being maintained as opposed to being implemented for the first time. therefore it makes sense to program it in a language that maybe takes a little bit longer to write something in initially, but is easy to understand and doesn't require you to know the entire codebase inside out in order to change only a small part of it, hence a language that is easy to maintain.

that language, for me, is java.

(shaggar is trolling but i'm actually serious :( )

Shaggar
Apr 26, 2006

Mr. Glass posted:

i think i hate java the most when it comes to reflection :v:

BOOOOOOOOOOOOOOOO!

Shaggar
Apr 26, 2006

ShadowHawk posted:

You can basically do this right now if you have social control over the coding standards and can force your peers to annotate their functions (and then use either one of the linters or runtime-type-enforcing libraries)

java is great because it forces everyone to use those standards or leave and go back to their lovely p-langs. all the poo poo p-langers hate about java is what makes it the best language.

Stubbs
Oct 24, 2005

i like javas reflection :kiddo:

brap
Aug 23, 2004

Grimey Drawer
otoh you could be using c# which is basically java but better in literally every aspect

Bloody
Mar 3, 2013

fleshweasel posted:

otoh you could be using c# which is basically java but better in literally every aspect

i was about to say except @ cross-platform but then i remembered that having no choice but windows was a good thing

Shaggar
Apr 26, 2006

fleshweasel posted:

otoh you could be using c# which is basically java but better in literally every aspect

visual studio is not as good as eclipse in a lot of ways and maven is way way better and so are checked exceptions, but c# has the best web framework and desktop framework

tef
May 30, 2004

-> some l-system crap ->

syntaxrigger posted:

do you have a favorite language?

some languages i like despite their faults, or because i've never had or wanted to use them for production work.

prolog is one of those languages. great at parsing but terrible at string handling. great for evaluation but terrible for computation.

i'll never use prolog in production, but there is a lot of fun decomposing your problem into rules and patterns. it's more like writing type annotations than writing in a programming language. it's somewhere between sql and regular expressions.

there is a lovely declarative element to a prolog program that i just haven't seen elsewhere. you can do incredibly large programs with little mechanical work. unfortunately most programs are very small bits of logic and lots and lots of mechanical parts.

prolog isn't entirely useless. oh god do you miss bits whenever you have to transform one tree into another, but i doubt i'll ever write a serious program in it.

Notorious b.s.d.
Jan 25, 2003

by Reene

Mr Dog posted:

my philosophy, as opposed to the plang philosophy, is this: "there are two kinds of software projects: failures, and legacy code".

iow if your software ends up being useful to anybody then it's going to spend most of its time being maintained as opposed to being implemented for the first time. therefore it makes sense to program it in a language that maybe takes a little bit longer to write something in initially, but is easy to understand and doesn't require you to know the entire codebase inside out in order to change only a small part of it, hence a language that is easy to maintain.

that language, for me, is java.

(shaggar is trolling but i'm actually serious :( )

java's original sin is its non-interactive nature. you type "python" and you can do something useful with python just by punching in an expression and hitting enter

if java had come with a repl on day one, all the scripting languages might have died in their infancies. imagine a world with no perl 5, no python 2, no ruby at all.

tef
May 30, 2004

-> some l-system crap ->

AlsoD posted:

it's python iirc

python is a language i will use, amongst others. i have been paid to write in vb6, perl, php, java, python, ruby, javascript, xslt and a variety of other little languages along the way. i've rarely had a free choice of programming language, there are usually larger factors in play, usually what the team is experienced with, or which has the most mature cross platform support, or the age-old, is it in a browser.

in terms of hacking poo poo up, like generating stupid unicode things, or toying around with prototypes, i've used python a lot. i've also written some larger toys in javascript and java too. i can't say the same for languages with type inference.

if you threw away a lot of the implicit casts in python, so no, an int is not a bool, a string is not a list, stop that. dropped faux preemptive threads in favour of coroutines, and threw in optional type checking, and proper adts i'd be so happy despite the many other warts. maybe even having both byte and unicode interfaces to the system would be good too rather than picking one over the other.

oh gosh if only. python 3 fixes some of my problems but introduces new ones by making bytestrings second class features. tulip is nice and about time, but eventlet is still easier, the enums are a good start, and there's a lot of hope in things like pypy. python is moving on in many ways but i strongly believe my biggest python grumps will never be fixed.

still, i find that python is the most "bang for the buck" scripting language. i can write much larger applications in it without craving explicit type checks and boundaries. features like generators, decorators, the with statement, and descriptors make for pleasant apis too.

but, my style of late has been pushing towards a lot of functional composition, and python has a love/hate relationship with it eg sum(key=...) is lovely, but lambda is clunky. python has been a great language to learn and explore my ideas and styles in, but i find myself wanting to go against the grain of the language as i've grown up a bit.

i've started to like immutable data structures. i've started to see mutation and in place update as an optimization to make later. i've started to like processes and messages over threads and locks. i am writing more and more state machines every day. a lot of this is due to the area of software i'm writing, this won't fit everyone.

python is not my preference, it's just the most convenient language at the moment for lazily slapping up prototypes and growing them.

tef
May 30, 2004

-> some l-system crap ->

JewKiller 3000 posted:

i find it hard to believe that tef would be so myopic as to have one p-lang for his favorite language and another nearly indistinguishable p-lang for his least-favorite language

python and ruby are both capable languages, it's just that a series of differences add up

- immutable strings so no symbol/string disinction, means you can safely use strings as hash keys, method and class names.
on the plus side, ruby now actually gc's symbols, or will, so there is less issue there

- import is really loving lovely and you can't normally add methods to built in types

- functions are first class, so you can do x = foo.method; x(). explicit self means some form of lexical scope

- i've found having a distinct unicode and string type is a lot nicer than having an 'encoding aware' string.

- what do rubyists call a library? a dsl. anyway, there is just a whole lot more focus on libraries than extensions to the language

- lots of exceptions thrown by default for invalid input

this is enough to make it significantly less frustrating to use. python isn't exactly clean and precise, but it isn't exactly unhygienic.

tef
May 30, 2004

-> some l-system crap ->
ruby and python may be both used for web apps, but the design and intent behind the languages are radically different in approach.

there is also a significant cultural and social difference too. ruby, but really just the 90% of it that is rails, has a lot of bravado, and macho posturing, possibly because of the vc backed startups writing in ruby on rails. a large part of ruby culture is startup culture. python has this, but not to the same degree. even the people who started django have a different attitude to dhh on many topics.


enough so that one is far more amenable to my taste.

Notorious b.s.d.
Jan 25, 2003

by Reene
i am an outsider to both communities and i find python/ruby to be more similar than different
  • stdlibs are riddled with surprising behaviors
  • they're wretchedly slow
  • threading is broken
  • package systems and runtime versioning are almost unspeakably terrible

tef
May 30, 2004

-> some l-system crap ->

Mr Dog posted:

my philosophy, as opposed to the plang philosophy, is this: "there are two kinds of software projects: failures, and legacy code".

i have been using a similar line as a joke for a while, but with a different outcome.

quote:

iow if your software ends up being useful to anybody

on the other hand if you're slapping together

- one off projects or websites (there are a lot of these)
- prototyping or exploring

then you'll probably find the following things as you develop your project

- a lot of your code was wrong or useless
- the problem has changed + your understanding of the problem has changed

then a p-lang might be useful. you know, like shell scripts. if you use the command line you are using one of the most p-lang things, like bash. if you've done something before, or you have a pretty good idea of the overall structure of an application, and know it won't change quickly, then a more serious language can be excellent.

sometimes the precision you gain early on by expressing type constraints can be revelatory in itself, but more exploratory or casual programs can be written for failure, rather than success.

although type inference and refactoring tools can be lovely at pushing and poking around an api, i'm still a text editor grunt at heart, and enjoy writing less code to delete later.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
pip is really bad

npm is surprisingly ok I guess

Bloody
Mar 3, 2013

idk rapid prototyping in c# is really fuckin pleasant

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

i am an outsider to both communities and i find python/ruby to be more similar than different
  • stdlibs are riddled with surprising behaviors
  • they're wretchedly slow
  • threading is broken
  • package systems and runtime versioning are almost unspeakably terrible

1. oh god yes, but i've found it to be far more so in ruby. eg urllib2 seems less bad than net::http.
2. yep, but more in ruby. python's had things like cython, and now pypy
3. yep
4. yep

guilty as charged.

but if you recall i tend to write business logic over C libraries, with the occasional posix call, using processes, and vendor packages, so honestly it's pretty good for slapping together C daemons

tef
May 30, 2004

-> some l-system crap ->

Bloody posted:

idk rapid prototyping in c# is really fuckin pleasant

fair enough

Bloody
Mar 3, 2013

tef posted:

1. oh god yes, but i've found it to be far more so in ruby. eg urllib2 seems less bad than net::http.
2. yep, but more in ruby. python's had things like cython, and now pypy
3. yep
4. yep

guilty as charged.

but if you recall i tend to write business logic over C libraries, with the occasional posix call, using processes, and vendor packages, so honestly it's pretty good for slapping together C daemons

if theyre in c u can just call them demons

tef
May 30, 2004

-> some l-system crap ->

Bloody posted:

if theyre in c u can just call them demons

~i call em services because they're application specific~

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
how much would you need to sacrifice from a language like ruby to make it a compilable language (which would make it faster right???)

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

tef posted:

some languages i like despite their faults, or because i've never had or wanted to use them for production work.

prolog is one of those languages. great at parsing but terrible at string handling. great for evaluation but terrible for computation.

i'll never use prolog in production, but there is a lot of fun decomposing your problem into rules and patterns. it's more like writing type annotations than writing in a programming language. it's somewhere between sql and regular expressions.

there is a lovely declarative element to a prolog program that i just haven't seen elsewhere. you can do incredibly large programs with little mechanical work. unfortunately most programs are very small bits of logic and lots and lots of mechanical parts.

prolog isn't entirely useless. oh god do you miss bits whenever you have to transform one tree into another, but i doubt i'll ever write a serious program in it.

i called it

Notorious b.s.d.
Jan 25, 2003

by Reene

MALE SHOEGAZE posted:

how much would you need to sacrifice from a language like ruby to make it a compilable language (which would make it faster right???)

it would no longer be source compatible. it's not that dynamic languages are hard to compile, its that perl/python/ruby weren't designed, they just grew.

js is badly designed in my opinion but it was indeed designed, and compilers are totally feasible

ruby/python/perl are riddled with horrifying implementation details that you can't handle without a frightening interpreter that resembles the original. (i read a really cool article on HN about the horror of pypy's hacks for cpython compat but now i can't find it)

Notorious b.s.d. fucked around with this message at 04:30 on Aug 26, 2014

Notorious b.s.d.
Jan 25, 2003

by Reene

tef posted:

2. yep, but more in ruby. python's had things like cython, and now pypy

ruby has a real garbage collector now

it's still slow compared to any real, usable language but 2.1 and 2.2 are probably pretty fast in the pissing match amongst phperubython

tef posted:

but if you recall i tend to write business logic over C libraries, with the occasional posix call, using processes, and vendor packages, so honestly it's pretty good for slapping together C daemons

so is tcl
or lua
or any other language with an FFI

if all you are doing is gluing together C libraries with business logic, safe yourself some time and hassle and jump to a JVM/CLR language right now. in light of your recent interest in immutability, f#, clojure, and scala will all glue together business logic very nicely.

additionally, if you ever have to write your own bindings: C#/CLR languages have way, way less lovely FFI than ruby or python. the JVM took a long time to catch up, but open source libs like jna and jnr bring it up to par

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

I don't know why you couldn't JIT ruby like you do JS and Lua and PHP -- what parts would be worse? and if you can JIT you can do AOT. you'll have a support runtime, but so do Java and C#.

people haven't done a compiler because nobody has cared enough about performance of ruby to put in the work, not afaict because it's an open research problem.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i dont understand why the goal of any language isnt to have both a jit for rapid development and an AOT for actual usefulness

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

MALE SHOEGAZE posted:

i dont understand why the goal of any language isnt to have both a jit for rapid development and an AOT for actual usefulness

AOT often doesn't buy you a ton of performance (especially vs pre-generated/cached JIT hints), and AOT usually makes much bigger binaries.

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

going to read the posts later b/c i gotta get to bed

thanks for the PL opinions

my fear of trying a thing has a mask of 'What is the best PL to learn for job, project, fun, etc?' when i logically know the answer is always 'it depends' hearing the differing opinions for different reasons kills some of that fear. maybe if enough of that fear is dispelled i can be a happy programmer among people excited about programming, if there is such a thing/place

so thanks

tef
May 30, 2004

-> some l-system crap ->
i thought that jits can out perform aot code due to extra information available from runtime profiling

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

tef posted:

i thought that jits can out perform aot code due to extra information available from runtime profiling

i dunno i dont know anything

b0lt
Apr 29, 2005

tef posted:

i thought that jits can out perform aot code due to extra information available from runtime profiling

"sufficiently smart jit" is just as handwavey as "sufficiently smart compiler"

raminasi
Jan 25, 2005

a last drink with no ice
i like f# because using it is like looking into the future of c# and vb.net

tef
May 30, 2004

-> some l-system crap ->

Notorious b.s.d. posted:

if all you are doing is gluing together C libraries with business logic, safe yourself some time and hassle and jump to a JVM/CLR language right now. in light of your recent interest in immutability, f#, clojure, and scala will all glue together business logic very nicely.

weirdly enough that decision has already been made for me.

i haven't done anything on windows in years, so f#/c# are unlikely to happen any time soon. scala is fiendishly complex, and performant scala is closer to java than idiomatic scala. finagle seems neat though. clojure seems interesting, and rich hickey seems smart, but i'm allergic to lisp languages and i have a note from my doctor.


quote:

additionally, if you ever have to write your own bindings: C#/CLR languages have way, way less lovely FFI than ruby or python. the JVM took a long time to catch up, but open source libs like jna and jnr bring it up to par

in many cases the choice was forced by which language had supported bindings for a particular library. i never had to write my own binding. if i had to write my own p-lang binding to a c-library i would wonder where i went wrong in life.

Adbot
ADBOT LOVES YOU

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

tef posted:

i thought that jits can out perform aot code due to extra information available from runtime profiling

they can, but it's pretty hard for it to beat a profile-guided AOT in the general case. it's also rare because most of the time there's some thunking out to less-optimized representations (the JVM stack machine, NaN boxing, whatever) at the edges of the compiled frontier. recompilation costs are real, as is the cost of having too many variants compiled and blowing out the icache. it's also pretty expensive to do whole-program analysis as methods are (re)compiled, but at the limit a JIT can be basically an AOT that runs at startup, so it blurs.

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