HNHacker News
TopNewBestAskShowJobs

juki

285 karma · joined January 14, 2017

submissionscomments
juki··on Nim 1.2
You have to declare the variable as `var` as well, eg.

    var arr1 = [4, 2, 3, 6]
    sort arr1

    # Doesn't work
    let arr2 = [4, 2, 3, 6]
    sort arr2
You'll get a warning about the latter from the compiler (and nimsuggest for editors).
juki··on Nim vs. Crystal
I'm not sure why you're comparing Crystal to Python here, but just in case you've misunderstood something, Nim is a completely different language from Python. It borrows some bits of syntax (like I suppose Crystal does with Ruby, but I haven't used either of them), but otherwise it has nothing to do with Python, so a performance comparison of Crystal vs. Python doesn't say anything about Crystal vs. Nim.
juki··on Belarus’s Soviet Economy
As far as I know, Europeans used to eat turnips and rutabaga, but in 1700s the potato mostly replaced them due to being cheaper and easier to grow.
juki··on XML is almost always misused
The example seems pretty weird. If it's just data there shouldn't be any quotes at all. The only purpose of quoting is to prevent evaluation, so I guess the idea must be that `log` is a function call to be evaluated, but then the example isn't even the same thing as the XML version (and there are still nested quotes inside the already quoted record).
juki··on I'm Resigning as a Stack Overflow Community Elected Moderator
The data dumps seem to still be available: https://archive.org/details/stackexchange
juki··on Why Isn't Functional Programming the Norm? [video]
Notice that they are using Common Lisp, which is a multi-paradigm language, rather than a more functional lisp like Clojure.
juki··on Please Add RSS Support to Your Site
I just use Emacs/elfeed[1] It's simple and fast with good tagging/searching. Thunderbird also supports RSS feeds.

[1]: https://github.com/skeeto/elfeed

juki··on Static Type Checking in Common Lisp
> Consider an identity function declared to only accept fixnums and returns fixnums. If you call this function with a string a type error will be signaled if run time type checks are enabled.

This would be the case that I referred to in the second paragraph of my last comment. I would agree if we were talking about explicit type checks, but a portable Common Lisp program cannot consider implicit added by the compiler to be part of the programs semantics, because a compliant implementation is not required to add any type checks. SBCL just adds them as a debugging aid, but if you rely on type errors being signaled, you have to check them explicitly with `CHECK-TYPE` or something equivalent.

> Think of soundness as a guarantee that if the program type checks

This would be where our view is different. You consider soundness to be a guarantee given by the compiler, while I consider it a property of the program itself (which can sometimes be checked by the compiler, and sometimes by the programmer). Common Lisp does not give any guarantee of type safety. SBCL simply tries to be helpful and catch most real world type errors, but ultimately it is the programmer who must ensure the soundness of the program.

juki··on Static Type Checking in Common Lisp
We must be using a different definition of soundness then. As I see it, implicit run time type checks do not affect the semantics of a program, and as such, do not have any bearing on its soundness. They're merely a debugging tool to help one detect unsoundness as early as possible in development, or to fail gracefully with good error logging in a production environment. Optimizing for `(safety 0)` only tells the compiler that you know the piece of code is sound, so there is no need to check at run time. It's still just as sound or unsound as it would be with the type checks.

I suppose you could argue that someone might write a program that relies on being able to call a function with the wrong type of arguments and catch the resulting error. In this case removing the type checks obviously changes the behavior of the program. This however would not be portable across different CL implementations anyway, so you should really be using explicit type checks.

> But the difference is the frequency in which it is lost. In SBCL Lisp, if you want fast code, the answer is "almost all the time".

SBCL code is fast enough for the vast majority of a program even with full run time type checking, so you would only be using `(safety 0)` for very performance critical code, whose safety you have ensured yourself. The `(safety 0)` declaration also does not disable any compile time checking that SBCL does.

juki··on Static Type Checking in Common Lisp
You don't lose soundness; you just tell the compiler to not check types at run time, because you've already done it yourself (e.g. by not exposing the unsafe code directly outside the package, but instead having a safe wrapper around it). This isn't really any different from using unsafe/foreign code in a statically typed language.
juki··on Static Type Checking in Common Lisp
This problem is somewhat lessened because SBCL also allows you to tell it to not add any implicit runtime type checks (explicit checks are still there) with an `(optimize (safety 0))` declaration. Of course, then you have to be sure that the code is indeed safe, so you probably don't want it as a global declaration, but only locally for the tight loops. When optimizing for speed SBCL also gives warnings for generic arithmetic, so you can add the necessary declarations.
juki··on Let's Get Going with Org-Mode
I assume those seconds are mainly JVM startup time. The existing ob-plantuml doesn't support sessions, so it evaluates every code block in a new instance of plantuml. Seems to me like should be possible to use the `-pipe`-option for plantuml so that you can send multiple code blocks to the same instance via stdin and get the images back via stdout. That's probably what VSCode does, but it doesn't seem like anyone has bothered to write that for Emacs so far.
juki··on Tor Browser 8.0.8
I assume this is meant to be about 8.0.9 rather than 8.0.8?

https://blog.torproject.org/new-release-tor-browser-809

juki··on The 'Dark Ages' Weren't as Dark as We Thought
Note also that the Spanish Inquisition operated during the Renaissance - early Enlightenment era, not the dark ages.
juki··on What's new in Ubuntu 19.04
No, there are two releases every year; a <year>.04 in April and <year>.10 in October.
juki··on Org-mode parser in Rust
> but the text editing required for OrgMode seems way too cumbersome

If you don't like key-chords then Emacs probably won't work for you, but just in case the video you watched wasn't clear about it, most of the markup is handled pretty much automatically by Emacs. Table creation and editing in particular works pretty much like in a graphical application. For example, if you want to create a table like

    | foo | bar | quux | qwerty |
    |-----+-----+------+--------|
    |  10 |  20 |   30 |     40 |
    |  50 |  60 |   70 |     80 |
All you need to do is insert the first row with the vertical bars to separate fields,

    |foo|bar|quux|qwerty
Then hit `C-c RET` and Emacs turns it into

    | foo | bar | quux | qwerty |
    |-----+-----+------+--------|
    |     |     |      |        |
with the cursor ready on the first cell under `foo`. Then you can just write the value and use tab to move to the next cell like in any spreadsheet program. Emacs will add new rows as needed and adjusts the table formatting automatically as you move to the next field (or when you hit `C-c C-c` if you don't want to move).

There are typical table editing commands available like moving, deleting and inserting columns or rows with [shift+]alt+arrows.

juki··on Org-mode parser in Rust
I believe Gitlab and Github both render Org files with OrgRuby[1], which is MIT.

[1]: https://github.com/wallyqs/org-ruby

juki··on Org-mode parser in Rust
By "various kinds of metadata", I don't just mean the document metadata (such as title, author, etc.), but also the metadata applied to specific elements such as the outline items, tables or code blocks.

For example, in Org you can add task management data, scheduling information and arbitrary properties to the outline,

    #+COLUMNS: %ITEM %TODO %ASSIGNED_TO %SCHEDULED %PRIORITY
    #+PROPERTY: ASSIGNED_TO_ALL juki some other people

    * TODO [#A] Some task with priority A
    SCHEDULED: <2019-04-20>
    :PROPERTIES:
    :ASSIGNED_TO: juki
    :END:

    Some description.
This defines a task with a custom property `ASSIGNED_TO` whose value can be one of ["juki", "some", "other", "people"], which can be viewed and edited in a column view. It could also be used by a custom export-backend or some other tool.

For another example, you can add formulas to a table,

    #+CAPTION: A table with formulas.
    | foo | bar | Row sum |
    |-----+-----+---------|
    |  10 |  20 |      30 |
    |  30 |  40 |      70 |
    |-----+-----+---------|
    |  40 |  60 |     100 |
    #+TBLFM: $3=vsum($1..$2)::@4=vsum(@I..@II)
Here the 10, 20, 30, 40 are added manually and the other cells are calculated by the sum-formulas. Since the results are inserted into the table, other tools can just skip over the TBLFM-metadata if they don't support it.
juki··on Org-mode parser in Rust
The big difference between Markdown and the Org-markup is that the latter has syntax for various kinds of metadata, while Markdown is purely content. That metadata is used for things like task management, literate programming, spreadsheets, customizing export behavior, etc.

One could, in theory, create an extended Markdown flavor that allows similar metadata, but that wouldn't be compatible with any existing tools anyway, so there's not much point.

juki··on Miller Columns
That seems a bit similar to the Ranger[1] given as an example in the article. There's also ranger.el[2] for Emacs. By default in ranger.el (and I assume Ranger too, but I haven't used it), B is the current level, A is the previous level and C is a preview of whatever you have selected in B. You can hide the preview (so the current level would be C) and add more previous levels. There's no compressed view of all previous levels though.

[1]: https://en.wikipedia.org/wiki/Ranger_(file_manager)

[2]: https://github.com/ralesi/ranger.el

juki··on Elon Musk Settles SEC Fraud Charges
It's part of the settlement:

> Tesla will establish a new committee of independent directors and put in place additional controls and procedures to oversee Musk’s communications;

juki··on Goodbye VSCode, Hello Emacs Again
> What VSCode offers on this front that strikes me as a really killer feature is the command palette.

You can use `helm-M-x` from Helm[1] to do the same in Emacs.

[1]: https://github.com/emacs-helm/helm

juki··on The IceCube Neutrino Detector at the South Pole Hits Paydirt
Those are Emacs style keybindings, which are the default on most shells. You've probably switched to Vi style bindings in zsh.
juki··on Fitbit employees charged with stealing trade secrets from competitor Jawbone
Right above (b):

> shall, except as provided in subsection (b), be fined under this title or imprisoned not more than 10 years, or both.

juki··on Justice Dept. Seizes Times Reporter’s Email/Phone Records in Leak Investigation
The last paragraph under that heading says the directive was declared invalid 2014.

> On 8 April 2014, the Court of Justice of the European Union declared the Directive 2006/24/EC invalid for violating fundamental rights. The Council's Legal Services have been reported to have stated in closed session that paragraph 59 of the European Court of Justice's ruling "suggests that general and blanket data retention is no longer possible".[18] A legal opinion funded by the Greens/EFA Group in the European Parliament finds that the blanket retention data of unsuspicious persons generally violates the EU Charter of Fundamental Rights, both in regard to national telecommunications data retention laws and to similar EU data retention schemes (PNR, TFTP, TFTS, LEA access to EES, Eurodac, VIS).[19]

juki··on Instapaper is temporarily shutting off access for European users due to GDPR
The GDPR was adopted in 2016. The two year grace period in your quote ends on the 25th.
juki··on Microsoft’s commitment to GDPR, privacy and customers’ control of their own data
Only the basic telemetry (which I assume doesn't include any personal data) can't be opted out of in Windows 10 home. Other privacy settings have to be opted in now. The recent "April update" forces you to say yes/no to all data collection settings.
juki··on Eshell as a main shell
Adding this to your init file would have changed the behavior to scroll only one line:

    (setq scroll-conservatively 30)
juki··on StreetLend.com shuts down, citing GDPR regulations
EU law says that it's only legal to transfer personal data to companies that have adequate level of protection for personal data. Certain countries are considered to meet the adequacy requirement, but Australia is not one of them[1], so you probably need to meet the requirement using a contract[2]. You should probably consult a lawyer.

[1]: https://ec.europa.eu/info/law/law-topic/data-protection/data...

> The European Commission has so far recognised Andorra, Argentina, Canada (commercial organisations), Faroe Islands, Guernsey, Israel, Isle of Man, Jersey, New Zealand, Switzerland, Uruguay and the US (limited to the Privacy Shield framework) as providing adequate protection.

[2]: https://ec.europa.eu/info/law/law-topic/data-protection/data...

juki··on Stack Overflow Culture
A lot of people don't seem to be aware that the Stack Exchange network consists of lots of different sites. StackOverflow is just the biggest one, but there are sites for all sorts of discussion: https://stackexchange.com/sites

Those sites all work exactly the same as StackOverflow and you can login with a single account. Just the rules regarding content are different. See for example https://softwareengineering.stackexchange.com/

There is also the Area 51 site for proposals for new sites: https://area51.stackexchange.com/

← PreviousPage 4 of 6Next →