Better HN
topnewbestaskshowjobs
Log inSign up

GrumpySloth

4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions

Submissions

comment 5y ago · link · parent

Not necessarily. Acme displays variable-width fonts just fine.

However, Emacs is not just a text editor, so it shouldn't be judged solely as a text editor.

comment 5y ago · link · parent

I'm writing my first C99 compiler. IOCCC sounds like a great source of test material.

comment 5y ago · link · parent

I thought that the point of this syntax was to make the compiler warn you when, what you think is a tail call, in fact isn't one, and demand that the compiler optimizes it; not introduce a completely new control flow construct.

comment 5y ago · link · parent

Exactly. It wouldn't be dangling without the transformation you proposed.

comment 5y ago · link · parent

Then you changed the semantics of the code. Now a program that e.g. prints a message in its destructor, which gives this output:

  Message 1
  Message 2
  Message 3
Will give this output:

  Message 3
  Message 2
  Message 1
Your odd/even fix also won't work, because a function may push an argument to a list, and pass the list in another argument, making the original temporary accessible from any recursion level.

A call to a destructor is a normal call. If you need to call destructors, then it means your tail call is a call to a destructor and not what you're seeing in the code. It's a fundamental semantical problem. You can't have "make the last call in this function be an implicit call to some function" and "make the last call be the explicit call to this other function" at the same time.

comment 5y ago · link · parent

It's not that it requires GC, but that it is disabled by implicit calls at the end of scope. Scoped destructors aren't only for memory management. They are also widely used for e.g. closing files or sockets, basically anything that you may think of as a resource. Go has the defer statement, which would also disable TCO, even though Go has a GC. You can call just about any function in a defer statement. You can have TCO in a language that has scoped constructors/defer statement and doesn't have a GC. It's just that the things that at first look like tail calls often aren't. But the same thing can be said about operator overloading. TCO will still be in this language, but it will only be applied to tail calls, not calls which the programmer mistakenly believed were tail calls.

comment 5y ago · link · parent

In my experience, it's not about being line-oriented. It's about being punctuation heavy or not. Lisp, except parens, for the most part doesn't have all that much punctuation (quotes and commas are rare). Now let's take this program in C++:

  #include <iostream>
  
  int main() {
      std::cout << "hello, world!" << std::endl;
  }
If my cursor is after "main", then M-f will move my cursor to after "std". It completely ignored "()" and "{". Another M-f moves my cursor to after "cout". Here it ignored "::". Another M-f moves the cursor to after "hello" ("<<" and the quote-mark ignored), another to after "world", and another to after "std" (quote-mark and "::" ignored) etc. It behaves similarly when hitting C-Backspace, where sometimes half a line disappears suddenly, because it was punctuation-heavy. I think once I stumbled upon code where it deleted several lines. On the other hand, when I have a variable like "big_number", then Emacs will happily jump into the middle of it. Even though it's an indivisible token in the eyes of the language's lexer. Of course there is a well-known hack of adding the "_" character to be recognised as a "word character". But it doesn't solve the issue really. The issue is that forward-word uses just one set of word-characters, instead of several sets of characters/regexes for different syntactic categories, which would enable jumping first to "cout" and then to "<<".

comment 5y ago · link · parent

> I have at times in the past made the (somewhat joking) observation that "memory leak" and "unintentional liveness" look very similar from afar, but are really quite different beasts.

Both situations prevent you from reusing memory previously used by other objects, which isn't being utilized for anything useful at that point. The distinction is valid formally, but from a practical point of view sounds rather academic.

> And to prove the difference between "cannot be referenced" (a property that can in principle be checked by consulting a snapshot of RAM at an instant in time) and "will not be referenced" (a larger set, we will never reference things that cannot be referenced, but we may not reference things that are reachable, depending on code) feels like it is requiring solving the halting problem.

As usual, looking for a general solution to such a problem is probably a fool's errand. It's much easier to write code simple enough that it's obvious where things are referenced. Rust's lifetime semantics help with that (if your code isn't all that simple, it will be apparent in the overload of punctuation). If not Rust, then at least it would be good if you could check liveness of an object in a debugger. In C you can check whether a particular allocation was undone by a free() or equivalent. I'm not aware of any debugger for e.g. Java which would let me point at a variable and ask it to notify me when it's garbage collected, but it sounds like something that shouldn't be too hard to do, if the debugger is integrated with the compiler.

comment 5y ago · link · parent

I find that the default movement commands in Emacs match Lisp syntax pretty well (although paredit is much better still, when quotes and commas are involved e.g.), but when I switch to C++, they're infuriating. Since I'm editing code written in a programming language and not text written in a natural language the forward-word command can often jump over an entire line worth of C++ tokens, and sometimes it jumps into the middle of a token. This mismatch is really tiresome. Vim commands usually hit closer to the "move by token" motivation, even though it's still just regular expressions. And so editing in it is a breeze (but then it has other disadvantages that deter me from it).

Overall, I don't think you need the full power of paredit when programming. For any given language, your editor movement commands understanding what tokens in this language look like will usually already be sweet and enough.

comment 5y ago · link · parent

So many comments written due to assuming that it's about iOS where App Store is the only method of app distribution. Apparently scarcely anybody reads TFA.

As far as the actual issue goes, it's their App Store, they have their rules and are free to execute them as they see fit. Given how you can easily distribute your apps outside of App Store, it's a completely different situation from the duopoly on mobile devices, where developers don't have a choice.

comment 5y ago · link · parent

This is a memory leak in a GC language as well, depending on what happens to foo in ...code that uses foo... Maybe it will become a field of some class, maybe it will get pushed to some queue, maybe it will get captured in a lambda, etc. You won't even be able to tell just from looking at this code in this one place alone, if you passed this pointer as argument to a function.

It is my experience that when people work with GC languages, they treat the GC as a blackbox (which it is) and simply won't bother investigating: do they have memory leaks? Of course not, they are using a GC after all, all memory-related problems solved, right? Right... With code that relies on free(), I can use a debugger and check which free() calls are hit for which pointers. Even better, I may use an arena allocator where appropriate and don't bother with free() at all. With a GC I'm just looking at some vague heap graph. Am I leaking memory? Who knows... "Do those numbers look right to you?"

Memory management issues are usually symptoms of architectural issues. A GC won't fix your architecture, but it will make your memory management issues less visible.

It is my experience that most memory problems in C come from out-of-bounds writes (which includes a lot more than just array access), not from anything related to free(). A GC doesn't help here.

comment 5y ago · link · parent

That's just exchanging forget-to-free for forget-to-drop-reference.

comment 5y ago · link · parent

Oh. I think that's a fair thing to do. Jira support isn't free either.

comment 5y ago · link · parent

For me it's also faster to read lifetimes, which have a standard concise syntax, versus ad-hoc documentation.

comment 5y ago · link · parent

I don't see how a GC would do anything with memory leaks. When you have a data structure containing some elements, and you keep a reference to the structure, because you need some data from it, but you let it grow, then you have a leak, GC or no GC. If anything, GC encourages memory leaks by making freeing memory implicit, something a programmer normally doesn't think about. And yet a resize/push operation on a vector (sic!) is just another malloc. One that will get ignored by a GC.

GC protects you against double-free and use-after-free, but memory leaks? Nope.

comment 5y ago · link · parent

Yup, similar is 3.5->3.7. The community also doesn't seem to value backwards-compatiblity, judging from the libraries.

comment 5y ago · link · parent

> You also have to pay to even comment on issues.

OP mentioned "non-cloud", so I assumed they wanted it self-hosted. You don't have to pay anyone for commenting in Phabricator when you're self-hosting it.

comment 5y ago · link · parent

I have more specific problems with Jira:

1. When editing a comment, the textarea is tiny and placed in a pop-up, instead of in the page. Can't resize that to see the comment better.

2. After disabling shortcut overrides, the shortcuts are simply disabled, along with the default browser behaviour for them.

3. Refreshing a page resets scroll-status. Seriously, webdevs, stop hijacking normal browser scroll behaviour. You always make it worse, never better.

4. If your login session times out when you're writing a comment, you can't publish it, but the error message isn't clear about the reason why. There was some button in the error message that caused you to lose the entire contents of the comment you were writing. Happened to me several times after writing comments 8+ paragraphs long. It's infuriating.

comment 5y ago · link · parent

Phabricator.

comment 5y ago · link · parent

"Bully"? As if people were supposed to specifically review licenses they create, whether they're compatible with every GPL clause. Nobody needs to care about GPL, it doesn't deserve special treatment.

Other licenses not compatible with GPL:

- Apache License (only version 2 is compatible and only with version 3 of GPL);

- GPL (v2 vs v3), as other comments already mentioned.

Are the authors of those licenses bullies? No. Nobody needs to care about your favourite flavour of copyleft.

comment 5y ago · link · parent

GPL is what leads to the ZFS-on-Linux problem. The clause, that prohibits ZFS from being combined with GPL, is in GPL.

comment 5y ago · link · parent

> The partial order of intervals, where any overlap means equality, is perfectly respectable

Not really, since then it wouldn't be an equivalence relation. Equality in mathematics is weird, but whatever it is in a given context, it's always an equivalence relation.

comment 5y ago · link · parent

If you clone the repo, you will see the mail addresses of authors and committers.

comment 5y ago · link · parent

> They're all different ways of doing the same thing. Of course there could be a benefit for cases where you have a limited stack size. The author says that there's no need to do this in Haskell, because the stack is allocated on the heap, but I still wonder what the constant factor overhead of doing this with a linked list plus data types is over simple recursive function calls.

When you use (non-tail) recursive function calls, your memory will grow faster than with an explicitly managed stack, because now at each recursion level not only will you store all the things you would store in the explicitly managed stack, but also all the other variables and some intermediate values. Explicitly managed stack, that is implemented efficiently (i.e. mostly contiguous memory, not a linked list like in the example given), will give you better performance and will be easier to debug, because now you can query its size and identify where in the program you're using a given amount of memory; in the debugger you can inspect it as a whole in a multitude of ways (as opposed to the black box of a function where you'll only inspect one recursion level at a time, leaving you with scattered information and without easy to read performance metrics). That said, recursion is usually the simplest thing to write on the first try, when coming up with a solution to a problem. But I do tend to "defunctionalize" later.

comment 5y ago · link · parent

You're projecting.

comment 5y ago · link · parent

There already is an equivalent feature in GNOME. Preview's code is of little value outside of Mac. It's also not rocket science, that the thing stopping other people from doing the same thing would be lack of access to original source code. :)

comment 5y ago · link · parent

Emacs has a GUI, which supports 1 and 3 out-of-the-box. It's the only way I use Emacs. It's the main reason why I use Emacs and not Vim.

comment 5y ago · link · parent

> 1. There are a lot of users that are just not comfortable with working at a shell prompt. Graphical editors mirror the basic Mac or Windows workflow (open folder, double click on file, edit) and key bindings.

Emacs has nothing to do with shell prompts. It's a GUI editor as well. Emacs philosophy goes against Unix. I e.g. never use the terminal mode. Otherwise, your points seem on-point.

comment 5y ago · link · parent

> Now with creekshaw being integrated we might be reaching there though.

I believe you meant cranelift.

comment 5y ago · link · parent

> and a greater purpose?

This part is presumptuous. "Greater" for whom?

> If so... what is the meaning of it all?

And what is the meaning of it all in the alternative? It's up to you. Maybe you don't need one. Maybe this question is meaningless.

1
5152535455