Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
weavejester
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
91.
▲
by
weavejester
4y ago
I've never seen raw sewage running down the street. Admittedly I've not been everywhere in London, and some parts are better than others, but it doesn't seem any different from any other city I've been in. It feels clean
92.
▲
by
weavejester
4y ago
Thank you, I'm glad some of the work I've done could be useful.
93.
▲
by
weavejester
4y ago
I've very recently changed my system from MacOS to Linux, so I've been reibuilding my Clojure environment from scratch. I've found the exact opposite in terms of maturity; Emacs support in particular is far more complete and
94.
▲
by
weavejester
4y ago
You said: "I don't understand why 0 ≤ i ≤ N wouldn't have worked instead". Was that a typo? Did you mean 0 < i ≤ N?
95.
▲
by
weavejester
4y ago
If we use inclusive ranges where 0 ≤ i ≤ N, then len(range(N)) == N+1. e.g. len(range(3)) == len([0, 1, 2, 3]) == 4
96.
▲
by
weavejester
4y ago
That would give a sequence of N+1 elements, though. Confusing if you had a function like range(N), for example.
97.
▲
by
weavejester
4y ago
Yep. And the advantage of namespaces over a naming convention is that they can be enforced by the compiler and shortened with aliases.
98.
▲
by
weavejester
4y ago
If you ensure that all object keys are uniquely named, then merging objects wouldn't be a problem. But unless you use some sort of naming convention to enforce it, the more keys you have, the more likely it is for naming clashes to occ
99.
▲
by
weavejester
4y ago
Javascript objects have some differences to Clojure maps that make them harder to use in the same way. For example, you don't have to store functions in objects in Javascript, but the language design encourages it. This is problematic
100.
▲
by
weavejester
4y ago
For the same reason you wouldn't design a web framework in Ruby that doesn't use classes. Technically possible, but you'd be fighting against the design of the language.
101.
▲
by
weavejester
4y ago
This is a topic that I think requires a more in depth article, but I'll attempt to justify myself as best I can in the limited space of a comment. In most languages, related data is generally represented by some manner of closed record
102.
▲
by
weavejester
4y ago
So, for example, email verification. There could be a watch that triggers when a new user is inserted into the database, and this triggers a side-effectful function that sends an email.
103.
▲
by
weavejester
4y ago
I haven't used Elixir enough to be particularly confident in an opinion about it. However, Phoenix appears to have a similar design to many other MVC frameworks, and if a conventional design works for a language, there's less ne
104.
▲
by
weavejester
4y ago
What would a 'Clojure on Rails' framework look like? I think that's the primary reason why such a framework has yet to find traction; there's no single, obvious way to go about it. The efforts made so far in this space h
105.
▲
by
weavejester
4y ago
Maps are open, while objects are closed.
106.
▲
by
weavejester
4y ago
siknad and uryga give good replies on dependent types and TypeScript's structural typing. There's also an experimental static typing system for Clojure that allows for typing of maps: (defalias NamedMap (HMap :mandator
107.
▲
by
weavejester
4y ago
It's not impossible to type check heterogeneous maps at compile time, but most static type systems don't support this. I think you'd certainly see much more friction trying to program like this in C# than you would in Cloju
108.
▲
by
weavejester
4y ago
Just imagine you're sending the data across a network, instead of between local functions. If you have a web service that spits out JSON, then you have data that is decoupled from code. That's not to say that the JSON data isn
109.
▲
by
weavejester
4y ago
You can still use types, as long as they don't encapsulate the data. Admittedly this is hard to do in some languages.
110.
▲
by
weavejester
4y ago
Ah, thanks, I had forgotten about that.
111.
▲
by
weavejester
4y ago
By "the use of violence", do you mean violence directed at the player, or violence perpetrated by the player?
112.
▲
by
weavejester
5y ago
> If there are regular expressions in the language syntax, or the library, it's a feature of the UTM. By "the library" do you mean the core library of the language? If a language didn't have regular expressions as par
113.
▲
by
weavejester
5y ago
There are two problems with making that distinction. First, by that definition, few languages have regular expressions as a feature. Second, in languages with support for syntax rewriting, that would mean the internal implementation, not th
114.
▲
by
weavejester
5y ago
If those features are supplied by libraries outside the core language, I don't think I'd count them. I use Clojure a fair bit, and that has a miniKanren implementation in the form of core.logic. Would I say that makes Clojure a re
115.
▲
by
weavejester
5y ago
Alan Kay defined object-orientated programming as having messaging, state hiding, and late binding. I think the ship has sailed on the last one, but the first two properties hold true for at least all the object orientated languages I'
116.
▲
by
weavejester
5y ago
It's when it's part of the core language, as any Turing complete language can implement any feature of any other Turing complete language. It's not a useful statement to say all languages support all features.
117.
▲
by
weavejester
5y ago
Obviously any Turing complete language can implement an object system, but that's clearly different from the language having an object system built in .
118.
▲
by
weavejester
5y ago
Polymorphism and dynamic dispatch don't equate to an object system in and of themselves. At minimum, I'd say an object system needs some form of messaging and state hiding. That is, an object holds hidden state, and responds to ex
119.
▲
by
weavejester
5y ago
>> Languages that mostly avoid mutable state don't tend to have object systems, for instance. > They do, in the form of closures. You can build an object system from closures, certainly, but I wouldn't say closures are ob
120.
▲
by
weavejester
5y ago
I'm not even sure structs are inevitable. You could write a language around open sets of key/value pairs, for example.
More ›