Programming thread

  • 🔧 I've been doing a lot of work. If you experience issues, please email me or post in the relevant thread: (Chat, Tartarus / Site Security, Technical Grievances).
    🔧 A recent connection issue caused by an errant Finland node impacting mostly Europeans should be resolved.
    🧊 New server is in an office waiting on a mexican.
  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
f# is a fantastic language and doesnt use curly braces for code blocks either.

I long thought i hated significant whitespace inherently. f# showed me that, no, i just hated python

LISP solved the syntax question half a century ago yet people continue to reinvent the wheel and needlessly use inferior tools. It makes me feel rather cynical and pessimistic.
 
LISP solved the syntax question half a century ago yet people continue to reinvent the wheel and needlessly use inferior tools. It makes me feel rather cynical and pessimistic.
Lisp just makes everything look the same, hence the big ball of mud analogy. Personally, I like the idea of a language like APL, but where anyone can make any symbols with any meanings—that is, without the boundaries of something like Unicode, total freedom—getting the same freedom Ken Iverson had when designing the language.
 
Lisp just makes everything look the same, hence the big ball of mud analogy.
I'm not sure what you mean. Having a syntax with lots of different symbols makes the corresponding features eye catching - "look, there is an array access, a pointer dereference, etc" - but what does that matter? You still have to read the code and understand the semantics.
 
I'm not sure what you mean.
I'm going to share some scattered thoughts rather than something more coherent, note.

The ball of mud analogy comes from the ability to add to Lisp and have everything resemble everything else easily enough, but I find this gives the symbols in the character set a special privilege, for one annoyance, so I wouldn't call it perfect or solved. Lisp lacks some niceties from APL, but I acknowledge these come from the latter's limitations. I regularly use ⍨ to reverse the order of parameters in APL, which is very convenient. It's possible to do these things in Lisp, reorder parameters without fanfare, but it's not effortless, and there's always weighing the cost of doing something possible with what's reasonable. I hate when I'm auditing some Common Lisp that uses some little library for one little function when I know a standard function would do, for example. Lisp tends to veer toward the right as indentation and nesting builds up, which is another pain. Common Lisp has named parameters, but they've got a runtime cost that they don't in, say, Ada, which makes all parameters named without the option to avoid this. In general, I like eliminating names as much as possible from my programming, so Ada's the worst and APL's the best, but every language I use has its place and lacks other places.
Having a syntax with lots of different symbols makes the corresponding features eye catching - "look, there is an array access, a pointer dereference, etc" - but what does that matter?
Oh, certainly, I never wonder about precedence when reading Lisp, which is a very nice weight lifted from my shoulders. I can literally feel it in my mind.
You still have to read the code and understand the semantics.
Yeah, I just wouldn't call the matter settled is all. Lisp is undeniably better than most other languages, but I'm certain better can exist.
 
In general, I like eliminating names as much as possible from my programming
Why? I find that with good naming, I hardly ever need comments. I also appreciate when languages themselves use consistent, descriptive naming. Racket is a great example. Predicates end in ?, functions with side effects end in !, and conversions use -> i.e. string->list, and they all use simple, descriptive names. Easy to remember and clear to read.
I regularly use ⍨ to reverse the order of parameters in APL, which is very convenient. It's possible to do these things in Lisp, reorder parameters without fanfare, but it's not effortless, and there's always weighing the cost of doing something possible with what's reasonable.
(defmacro call-reversed (function &rest args)
`(,function ,@(reverse args)))
Lisp tends to veer toward the right as indentation and nesting builds up, which is another pain.
Avoid writing long functions.
Rule: No function should be longer than what can be printed on a single sheet of
paper in a standard reference format with one line per statement and one line per
declaration. Typically, this means no more than about 60 lines of code per function
Rationale: Each function should be a logical unit in the code that is understandable
and verifiable as a unit. It is much harder to understand a logical unit that spans
multiple screens on a computer display or multiple pages when printed. Excessively
long functions are often a sign of poorly structured code.
- NASA "The Power of Ten"

APL's the best
q←{1≥≢⍵:⍵ ⋄ p←⍵[⌈(≢⍵)÷2] ⋄ (∇ ⍵/⍨⍵<p), (⍵/⍨⍵=p), ∇ ⍵/⍨⍵>p}
wtf.jpg
 
Last edited:
If they didn't want us to use the whole of the unicode space they wouldn't have added those glyphs to unicode.

I remember when Swift was new and one of its big selling points was that you could use non-ASCII symbols, including emoji, in identifiers.

(Gimmicks aside it's genuinely useful for devs who have little English fluency.)
 
Why? I find that with good naming, I hardly ever need comments. I also appreciate when languages themselves use consistent, descriptive naming. Racket is a great example. Predicates end in ?, functions with side effects end in !, and conversions use -> i.e. string->list, and they all use simple, descriptive names. Easy to remember and clear to read.
I agree, but at the same time I still greatly enjoy eliminating names wherever possible. APL enjoyers call this tacit programming, and it's delightful. John Backus designed a language, FP, which goes even further than APL and it looks fun to use.
(defmacro call-reversed (function &rest args)
`(,function ,@(reverse args)))
Yes, but consider how that doesn't play nicely with &KEY or &REST parameters. The full solution just isn't worth it, really, so it's always easier to just ignore the annoyance, unfortunately.
Hey, check out the Wordle solver I wrote here.
I remember when Swift was new and one of its big selling points was that you could use non-ASCII symbols, including emoji, in identifiers.

(Gimmicks aside it's genuinely useful for devs who have little English fluency.)
Ada also allows this.
 
I'd love to actually learn APL (or rather BQN) but I struggle to understand how the data flows and the order of operations

so instead I larp by writing Uiua instead, which is stack based
 

I've tried it a couple times in the past, but have ultimately given up each time because after a few days it so perfectly replicates the experience of the client announcing a previously-undocumented yet absolutely crucial requirement on the day before the project was scheduled to go live. And if I'm going to deal with that I might as well get paid for it.
 
I've tried it a couple times in the past, but have ultimately given up each time because after a few days it so perfectly replicates the experience of the client announcing a previously-undocumented yet absolutely crucial requirement on the day before the project was scheduled to go live. And if I'm going to deal with that I might as well get paid for it.
I have about 140 stars altogether with my best results in individual years being about 30 each.
 
Back
Top Bottom