Better HN
topnewbestaskshowjobs
Log inSign up

gopiandcode

1,211 karma · joined Jun 5, 2019 (7y ago) · 196 submissions

pronouns: she/her

url: kirancodes.me

Submissions

comment 6y ago · link · parent

Good point, although it's also hard to justify Vim's 18MB vs Ed's 52K.

Look's like Vim is just too bloated for the modern minimalism focused user.

comment 6y ago · link · parent

I believe this is more of a problem for centralized services - federation gives freedom to the user to choose the level of moderation/censorship they want - if you find certain communities distasteful, you can just join servers that block these communities.

I think it is important however to have a strong emphasis on the separation of the servers from the protocol though - no one seems to care that Nazis could use email to have their own mailing lists.

comment 6y ago · link · parent

I have almost the same setup, except use the vterm emacs package as my backup shell instead of alacrity - while vterm doesn't integrate with emacs as well as eshell (no redirecting into buffers/calling elisp functions), I prefer it to an external shell, as I can keep my emacs bindings in the shell and share the kill ring.

comment 6y ago · link · parent

I've also experienced some difficulties with getting pass to play nicely with gpg, but the hassle was definitely worth it. An integrated pass and gpg setup allows for a single consistent means of authenticating and comes with the idle timeouts that you mention.

When I want to push to a git repo and authenticate with my private key, I just run git push normally, and a pin-entry prompt comes up, and I just need to enter my master password. Similarly, when I want to use a stored password for logging into a website, I just click the passff extension and enter my master password into the pinentry program. It would seem like something like spicypass would just bloat my system, requiring multiple programs for authenticating in different ways.

I can understand the drive for minimalism, but I can't see any reasonable metric by which pass could be seen as bloated - it provides a small set of features that are important for a password store and nothing more.

comment 6y ago · link · parent

Before self-hosting, the rust compiler was originally in OCaml so presumably there's an overlap in communities there.

comment 6y ago · link · parent

At the moment, it just gracefully disables itself so the movement commands revert to calling the corresponding Tuareg and Merlin operations. This is mainly because I currently rely on the vanilla OCaml parser to build the AST which doesn't handle recovery from syntax errors.

In the future I plan to move over to the Merlin parser, which has partial support for syntactically invalid buffers (I believe it wraps invalid regions with another syntactic construct), so it should still be possible to move around in other parts of the buffer.

As an aside, as I mentioned on the OCaml forum, I haven’t found this to be a major issue as I find that most of the time when I’m moving around (i.e not inserting text), the code is usually syntactically correct - I’ve also bound M-RET to insert a type hole (??) to easily allow movement even when I haven’t completed a function definition, and overall this leads to quite a natural editing experience.

comment 6y ago · link · parent

That makes sense - I'd assume restricting movement to just ast-based edits would be too constrained and would ultimately just limit the types of transformations users could perform (especially important when the syntax is wrong, or when making the AST temporarily invalid).

Have you had a look at the various Emacs plugins for editing lisp? Given the simplicity of the syntax, it would be fairly simple to make a lisp editor only performs AST-based transformations, however most lisp plugins support a mixture of both AST and line-based transformations. I find this approach to be very natural, allowing me to rely on the AST when I need it, and then being able to ignore it when I don't need it. My main motivation for gopcaml-mode was just to achieve a similar editing experience for OCaml code.

comment 6y ago · link · parent

As it happens, my main inspiration for writing this plugin was primarily due to the extensive support Emacs provides for performing structural edits in lisp. After having experienced the ease and speed at which you can naturally transform lisp programs by using the expression-level movement and editing commands, it was rather annoying to find myself frequently relying on character level movements to account for small issues with tuareg/merlin's movement commands.

Also, after actually setting this whole thing up, I now believe ocaml has the potential to provide an even better editing experience than lisp if structural editing is properly implemented, as the comparative lack of delimiters means that ocaml is quite quick to type in (and structural support should mean that this doesn't come at the cost of movement speed). Hopefully I've got the ball rolling with regards to structural editing of ocaml code, and I'm eager to see how this area progresses.

189.

Structural OCaml Editing in Emacs(discuss.ocaml.org ↗)

138 points · by gopiandcode · 6y ago · 9 comments

comment 6y ago · link · parent

Have you ever written a program that incorrectly looped forever? or one that deadlocked? or had any such other liveness bugs? I can't speak for you, but I certainly have, and, if the questions on stackoverflow are to be considered representative of typical humans, then it seems most other programmers have also done this at some point in their lives.

In general, human answers to halting problems have no guarantees of soundness or completeness, and can't be guaranteed to be correct unless presented as some kind of proof in some kind of logic.

Then, if a human can use some logic system to guarantee that a particular program halts, then a turing machine could also trivially solve this problem, by simply enumerating and verifying the possible proofs of program in the logic system. This proof strategy has further benefits beyond ad-hoc human reasoning, in that it is guaranteed to eventually find the proof if it exists.

comment 6y ago · link · parent

I think the documentation would benefit from suggesting the use of the `dune init ...` commands for beginners - ideally somewhere on the github readme or the readthedocs quickstart.

When starting out with OCaml, as I was more accustomed to makefiles, the process of setting up dune projects was a major hurdle. I later found the init commands while looking through the man pages, and was surprised it wasn't more clearly mentioned in the project documentation.

comment 7y ago · link · parent

Given that in the problem the value of r was fixed to 1000, the specific algorithm that would solve the problem instance would have been O(n) in terms of the input size.

comment 7y ago · link · parent

I generally don't like using tabs, as I find having two characters for whitespace leads to annoying inconsistencies. However, were a team member request I use tabs for accessibility reasons, I would have no issue complying.

That aside, I don't feel that this particular argument any stronger than any personal preference, let alone some kind of be-all final reason.

Generally whenever more than one space is used consecutively it is intended for indentation purposes - thus an equivalent solution to the accessibility problem is to just configure the editor to render consecutive spaces differently.

The post author calls for more editors to support adjusting tab widths showing that using tabs isn't automatically an accessibility win - spaces users could just as easily call for more editors to support custom ligatures to help the visually impaired.

comment 7y ago · link · parent

Requiring that a company provides access to the consumer doesn't preclude the existence of regulations ensuring safe usage.

If a user/team of developers were able to develop their own AI system which could operate to whatever safety constraints are set out by the law, on what grounds would you deny them from running their cars using the AI?

Similarly, we can all execute whatever code we want on our laptops, which also allows us the potential to cause harm by attacking other systems, but doing so would still be illegal.

comment 7y ago · link · parent

I believe the best way to separate 1 from 2 and 3 is to try and push for the removal of the artistic components of Advertising.

For example, to allow for creative expression, concepts such as puffery (unfounded claims) are explicitly allowed in adverts, and while it is true that they facilitate this kind of art, they are also prone to abuse when a profit motive is involved.

comment 7y ago · link · parent

While the question seems a bit arrogant/ignorant, I really dislike the snarky quora-styled response.

I go to stackoverflow for answers, not stories or opinion pieces.

1234567