Programming thread

yeah i know those movement commands i just never use them
i don't need to type faster since most of the time spent programming is spent on thinking (if your programming speed is limited by how fast you can type, you are not programming, you are instead doing something called "data entry")
Don't you care about iteration speed?
It's so nice to be able to quickly navigate to a piece of code, change it and run again.
 
Don't you care about iteration speed?
It's so nice to be able to quickly navigate to a piece of code, change it and run again.
yeah i like quickly navigating around between pieces of code and docs and shit and i mainly use the mouse and arrow keys for that since it just werkz
 
remember ruby shills? man...
Bro, I'm right here. The problem with us Ruby shills is that we're pretty violently pragmatic, so you don't get the shill pathology, as your average decent Rubyist will tell you to use another language if it fits. But Ruby's great for a whole lot, and not suitable for quite few applications. If I'm looking to add C-language interop with a scripting language, for example, Ruby's my first choice unless I'm trying to be particularly compact, then I'd use Lua.
 
Bro, I'm right here.
woah i thought you were the local prolog shill
The problem with us Ruby shills is that we're pretty violently pragmatic, so you don't get the shill pathology, as your average decent Rubyist will tell you to use another language if it fits.
amazing i haven't seen a ruby enthusiast talk about how pragmatic they are in YEARS

i actually don't hate ruby or ruby enjoyers i just haven't seen many in a hot minute, where are they :(
If I'm looking to add C-language interop with a scripting language, for example
does it have an extremely based ffi like what the schemers were showing off a few pages back
 
woah i thought you were the local prolog shill
Ruby for quick hacks and coding for pleasure, Prolog for higher-order stuff and brain work, C for speed. "Or you could just use Scheme and get all three at once!" But yeah, I'm old enough and learned enough that I use what I find comfy.

Ruby's now that weird Japanese language, and the thought of most newbies is "Why learn that when you could learn Python?" and other than Ruby being lovely to code in, there isn't a real reason to choose it over Python, and most of the folks who would have gone for interpreted languages in the past have moved on to the next-gen compiled languages like say Zig or Crystal or Nim or whatever.
 
"Or you could just use Scheme and get all three at once!"
nah even as a dedicated list processing sperg i wouldn't say it's the greatest language for everything
sure it might be one of the most elegant and beautiful languages out there, but the experience as a programmer can be a bit unfun
you have a million implementations with slightly different goals, with quick-hacking schemes that run a bit slow and extremely fast schemes that don't have all the nice srfis

and as a side note: even though i don't use it, i'm confident you could get ruby running about as fast as a middle-of-the-road scheme if you tricked it out just a little bit
 
I see python as the language where any niggerlicious trash you write will work 99.99% of the time as long as it looks like it will work. It's indistinguishable from pseudocode to me; you can write some shitty sketch with 0 planning and somehow it fucking runs.
My favorite example of this is list comprehensions.

sure it might be one of the most elegant and beautiful languages out there
cough cough Lambda calculus cough
 
Last edited:
My favorite example of this is list comprehensions.
It helps to think about python's iterable comprehensions in terms of set construction, they're somewhat similar conceptually, albeit python's syntax for it is atrocious, especially if you have nesting.
 
It helps to think about python's iterable comprehensions in terms of set construction, they're somewhat similar conceptually, albeit python's syntax for it is atrocious, especially if you have nesting.
It makes perfect sense in a mathy way, but I argue that's because math notation (e.g. set builder) is meant to be written by hand, so a lot of abbreviations and shorthand are used. List comprehensions feel like the kind of shit you write out as part of a prototype on a napkin.
 
It makes perfect sense in a mathy way, but I argue that's because math notation (e.g. set builder) is meant to be written by hand, so a lot of abbreviations and shorthand are used. List comprehensions feel like the kind of shit you write out as part of a prototype on a napkin.
It's awful. The if-else ternary syntax with nested loops has incredibly unintuitive syntax. For me it's one of those things I always have to look up in spite of doing it hundreds of times.
They also really only work for simple cases, and when written properly, I'm skeptical of whether the syntactic salt is anything more than flexing, like people who write java code only using streams even though they could just write a loop.

I actually wrote my own fp-inspired library so that I could have terse syntax, (was doing a lot of async generator stuff, abstracting it a bit made the code cleaner and more flexible), because I hated generator expressions that much.
 
My favorite example of this is list comprehensions.
that reminds me of how i wrote list comprehension to print out memory offsets for a todo app in 6502 assembly that ive never finished
it would calculate the memory offsets (space for like whatever is max width for c64) starting at the specified starting point and then print them out in the assembler format ($DEADBEEF instead of 0xDEADBEEF)
 
List comprehension is application of monads btw.
f a b = a >>= \x -> b >>= \y -> return (x, y), f a b = [(x,y) | x <- a, y <- b] and
f a b = do x <- a y <- b return (x, y)is the same.
that would be quite neat if i could actually read that shit without giving myself a fucking migraine
 
Two most common programming advices:
- Python is fast enough
- Compiler is smarter than you

I hope they play along nicely :ratface:
"Premature optimization is the root of all evil"
python is sort of in that perl niche where the language itself has a nightmarishly ugly design but nobody cares because there is a really nice library for mangling whatever kind of file you have to mangle and you don't want to waste time making and testing the libraries yourself (it can take a while)
How is Python nightmarishly ugly? Also I like to have the ability to just print nested data structures without serializing them and exceptions without a third-party library.
ii think a lot of the python shills have moved on (some of them went to ruby for 3 days and most went to rust eventually) and i don't think they will add c syntax because iirc they still don't even have lexical closure on their functions
Python absolutely has lexical closure:
It helps to think about python's iterable comprehensions in terms of set construction, they're somewhat similar conceptually, albeit python's syntax for it is atrocious, especially if you have nesting.
Set comprehensions also exist:
I agree that the syntax for nesting (and conditionals while we're at it) is sufficiently counterintuitive that I have to look it up on the rare occasions I use one or both.
 
No, John, you are the jeets. If it worked the way you wanted, threading.local().x = 0 would clobber any other module's use of a thread-local variable called x, which would be retarded. It's not like thread-local variables in C must automatically have external linkage either.
If they wanted to have separate thread-local namespaces for each module, they should have just made you pass in the current module's name as an argument, something like threading.local(__name__), and then return the same namespace object if called again from the same thread with the same module name. Making you create a namespace and then pass it down explicitly as an argument to anything that might need access to it defeats the entire purpose of thread-local storage (which is to provide variables with global scope but different bindings for each thread).
 
If they wanted to have separate thread-local namespaces for each module, they should have just made you pass in the current module's name as an argument, something like threading.local(__name__), and then return the same namespace object if called again from the same thread with the same module name. Making you create a namespace and then pass it down explicitly as an argument to anything that might need access to it defeats the entire purpose of thread-local storage (which is to provide variables with global scope but different bindings for each thread).
Just use inspect to stick it into frames manually bro
 
I was doing some research and I saw that Interlisp has been brought back from the dead. It was a DARPA-funded effort of Xerox PARC reminiscent of Smalltalk and you can run it locally or even in your browser (just not full-fledged).
 
How is Python nightmarishly ugly?
see:
the syntax for nesting (and conditionals while we're at it) is sufficiently counterintuitive that I have to look it up
any language that makes you have to look up its syntax so you can nest a construct is more retarded than redditors meme perl as being
I like to have the ability to just print nested data structures without serializing them
lisp invented this in the 1200s when monks working by candlelight discovered how to write parentheses
Python absolutely has lexical closure:
https://realpython.com/python-closure/
sloppy as fuck but mildly informative
why declare variables as nonlocal though is python a statically typed language now
 
Back