come to think of it, you could fix the noisiness by having two sets of syntax: the usual long-form { } syntax and a short-form [ ] syntax for when you want to make a simple, quick literal:
let someNums = [1, 2, 3, 4]
let aDict = [
"foo" = "bar",
"baz" = "qux",
1337 = 7331,
]
both would create the same type of value (a Lua-style table) but one would be a shortened form of the other
imagine a language like Lua except every table literal is actually a block of code that is run like a module. for example:
let someTable = {
export someValue = "foo"
let privateValue = "bar"
}
print(someTable.someValue)
# prints "foo"
print(someTable.privateValue)
# error
that would mean that when you require("someModule") you’re essentially wrapping the entire someModule file inside of { } and getting the result
it would make table literals more noisy but it would also let a Lua-like language have even fewer concepts that need to be learned in order to understand it
plus, you could define a whole class inside of one set of { } which would make the syntax mirror how most other languages do classes - and create a visual divide between the class and any unrelated stuff that might exist in the same file:
let SomeClass = {
export new = (value) -> {
let newInstance = {
let privateValue = value
}
setmetatable(newInstance, this)
return newInstance
}
export getValue = (this) -> {
return this.privateValue
}
export setValue = (this, value) -> {
this.privateValue = value
}
}
let instance = SomeClass.new("foo")
you could even make it so that if you return inside of { } then the whole { } block evaluates to whatever you returned, so you can have multiple statements inside of your expressions (and not just table expressions) just like in Lisp:
let fibonacciNums = {
let a, b = 0, 1
let nums = {}
for _ in range(100) do
a, b = b, a+b
list.push(nums, a)
end
return nums
}
print(fibonacciNums)
# {1, 1, 2, 3, 5, ...}
@harmonycorrupted @trinityblair I’m curious why not - do they have bad associations with the platform, or just see it as too niche?
Random violin teaching moment
One my favorite questions to ask is: “What did we do in here together that you wouldn’t have thought to do on your own?”
A primary goal for me as a teacher is to teach students how to teach themselves. I want them to be as independent as possible and have the tools to learn and play music on their own
the problem with Windows is that it can take a lot of tinkering to get Linux software to run
the problem with Linux is that it can take a lot of tinkering to get Linux software to run
It is depressing if someone experiences hate on here, especially if it puts them off using this place.
I follow people that regularly raise these issues, to hear how bad it is and what the causes are.
Five things seem to come up most often:
- Lack of representation in software design
- Users not being able to control who can reply to their posts
- Moderation being reactive rather than proactive
- Allowlists vs blocklists
- Cultural problems
Let's look closer...
🧵 Thread - Part 1 of 7
People say you shouldn't compare apples and oranges but it seems to work fine for me in Python 3.14, I don't see what the issue is...
The Japanese Bee Fly mimics a bee, is super cute and was the inspiration for the Pokemon Cutiefly
Hey Fedi,
How are you doing today?
Everything okay? Do you need a hug?
I bet you could use a hug.
🫂
a thing about Lisps that I find very beautiful is that you can learn their basic rules (syntax, macros, and execution) very quickly and easily*, and after that point you’ll understand all you need in order to make sense of anyone else’s code (as long as you can look up the forms that they’re using). you’ll never run into a situation where you don’t know what you’re looking at, syntactically speaking - which can happen a lot in non-Lisp languages
but a big complaint that I have about Racket is:
I get the feeling that Racket is overall a very complex and densely-packed language - designed to give users as many options as possible. and I have mixed feelings about that approach. it makes the language less beautiful to me, and harder to learn, but there might be a lot of practical value in doing things that way
* nothing involving programming is quick and easy, but it’s “very quick and easy” compared to learning the equivalent information in almost any other language
first impressions of #Racket seem pretty good! it has some stuff that I don’t like from other Lisps like:
it’s also a very very complex language compared to Janet or Fennel. but the things that I really like about it are:
my overall first impression of Racket is that it’s the Python of Lisps: it’s very complex and full-featured, but it also cares deeply about being as easy and friendly for beginners as possible, and I think that’s one of the most important traits for a language to have
On the next episode of Sweaty Bearded Men Cussing a Lot While Doing Manly Jobs (only on the Discovery Channel): another mechanical failure threatens the livelihoods of the sweaty men! Can they overcome this equipment failure throw sheer force of swear words and turn a profit?
@tempest I really am too. until I found Fedi I thought that the entire internet was like that, and I even thought that it was normal. but I’m glad that I have some perspective now and I’m not steeped in that toxic culture anymore
code is a pidgin language between computers and people. computers are very logical and consistent, but people are incredibly messy and chaotic and diverse
there’s such a wide variety of programming languages and styles (imperative, object-oriented, statically-typed, functional, etc.) because those styles are meant to serve different cultures of problem-solving, which value different things (speed, various definitions of “elegance”, various definitions of “safety”, etc.)
I grew up on reddit, though, where every user has to find a reason why they’re smarter and better than all of the other users. so I grew up hearing sentiments like:
and I learned to be very defensive about what works for me, because the cultural assumption was that one of these languages must be the superior choice and only a chosen few geniuses can understand which it is and use it properly - and I didn’t want to be one of those ignorant plebs using an inferior language for idiots instead. so that’s why I am the way I am towards Rust and anything related to functional programming