1,405 karma · joined October 28, 2016
1) i did a quick skim of the predicate transformer wp page, looking at weakest preconditions and taking a short detour onto the definiton of hoare triples. i _think_ it is about minimal pre-statement (statement being the active code in question) assertions and maximal post-statement assertions and using that as a basis to define your program/algorithms. this leads to strong conclusions about the correctness of your code. i would say this is a great and perhaps necessary goal for important systems. i try to do it at a slightly higher and less rigorous level with automated tests, but the desire is the same, and if i really wanted correct code, i would probably do just this sort of thing.
2) i've been programming for a while. about a year and a half ago i noticed that i was falling into this bad habit that i had worked hard to get out of many years ago where i would just take a stab in the dark, tweak some code, and run my program over and over until the output was correct. :feelsbadman: since that time, i have made an effort to develop a habit of thinking much more before running my code, and it is showing results. often i can write code for hours, once recently i even did so for days, and not execute it, reasoning as much as possible about execution and state along the way, and when i finally run it, there are bugs but they are usually quite shallow and i can fix them quickly and then bam! it just works. sometimes i pause in this and for the satisfaction of running my new code i will write automated tests that check the correctness of some of the functionality. and i have paused at times and written in my notebook, explaining to myself what the problem is that i am trying to solve, why my current solutions have failed, and reasoning about what a good and working solution might look like, and designing it before opening the IDE. that works wonders too. i would say again - i'm not quite as rigorous as he was, but the method has helped me write better code.
3) yes, i have done this before, and i try to emulate the idea in my (high level) code. but i'm definitely not at that rigorous level :)
and thank you for the reminder to avoid wasting time.
Neil Gaiman has a speech called "Make Good Art" and i read the transcript (he has made a short book out of it) and watched a video of him actually delivering the speech at a graduation ceremony yesterday. i will conclude with a quote from that speech.
> There was a day when I looked up and realized that I had become someone who professionally replied to email, and who wrote as a hobby. I started answering fewer emails, and was relieved to find I was writing much more.
I have a couple of questions:
1. Will I be able to use this in my IDE (say JetBrains or VSCode) alongside the programming language’s LSP? So that this project would only be in effect for the Pg SQL bits?
2. I am a Rust newbie but I’m an experienced developer. Is there any room for someone like me to contribute to the project?
good code solves the problem at hand. good code is as simple as possible. good code is testable and tested. good code is minimal. good code is performant. good code is maintainable. good code is understandable.
yes it matters somewhat that you have some consistency of the way you code. that's a secondary thing
this is not sarcasm. so often i have wished for something like this. and now i know that it exists!
sincerely, a long time firefox user
I really enjoyed this response and I have learned from it. (Which I guess an LLM could not do while generating something!)
Some references I glanced at (I mostly read the top paras):
- https://en.wikipedia.org/wiki/In_situ
- https://en.wikipedia.org/wiki/Theory_of_mind
Really enjoyed this response, and feel like I've developed a better understanding of some of the concepts relating to generative ML as it is used in LLMs.
An aside: I took a course on ML in a university a few years back, and it was interesting (it was an intro and survey course offered by the CompSci faculty), but difficult for me. I excelled at implementing using Keras/TF code in Python, and I had fun manually implementing some gradient descent algorithm but a lot of the math including all of the multi-var calc, stats, probability was quite difficult for me to wrap my head around, and I really didn't feel like I got a solid grounding on a meta-level of what we were doing or why. I have been reading a bit about LLMs and I think your post has filled in some of the gaps in what at this point I was really looking to understand.
so i ask you a followup question: what are some easy to understand ways in which a human's thought process would differ from an llm's behavior?
also for anyone else wondering: https://www.merriam-webster.com/dictionary/qualia
Edit: as noted in the linked ticket, there are some discussions going on about this in https://www.reddit.com/r/firefox/ .
I wrote my own thoughts on the subject on a couple of other threads:
- https://news.ycombinator.com/item?id=35274017 - on an article on (Google) Bard
- https://news.ycombinator.com/item?id=35020806 - on an article about a tool called Self-Learning Agent for Performing APIs (SLAPA)
i code in go these days. i have done perl and java and some others, started with c, did a bit of python along the way. ruby was always my favorite language. so expressive, so easy to be clear while being terse. i've spent months of my life shortening (my own) verbose ruby code. i switched to go only because of the execution speed and the compilation, a few years back the comparison was not even close. i don't know if i would like to go back to dynamic language... but i found ruby to be such a beautiful language.
p.s. this was big when i was leaving ruby: https://rubocop.org/ maybe there is a replacement now, but maybe it would have changed your view.
> Meaningless
>
> Yes GitHub stars is a totally meaning less metric that does not say anything real about a project like curl. It does not reflect usage, it does not reflect popularity and it does not reflect the number of installs out in the real world. It’s just a vanity number.
That made me lol.
I also am pretty sure I read about someone here on HN who used Crystal to build the code for their profitable cookie baking/selling business (the baked goods). I can't recall the details exactly. Edit: Here it is: https://news.ycombinator.com/item?id=23433847
Summary:
- Ruby-inspired syntax
- statically-typed, with built-in type inference
- types are non-nullable, with nullable types represented as a union of a type and nil
- macros built-in including templating, AST inspection, type inspection, ...
- green threads ("fibers") for concurrency
- C-bindings built-in
- package manager built-in ("shards")
(also it is compiled and cross-platform with Windows functionality in some kind of preview/beta that the article author found mostly usable [I think debuggers and the interpreter were exceptions here], and it has a large standard lib)
LSP is pretty well supported in editors; it has emacs and vim and vscode support (a lot of other support as well). It makes it possible for any editor that supports LSP to be language aware (supporting the use of code completion, syntax highlighting, warning and error messages, and refactoring tools, per the Wikipedia article). All that is needed is for someone to implement a language server for the language. I used to use Perl a few years ago and even that had some (slightly buggy) LS implementations, which I found very helpful.
I haven’t used Crystal but I did use Ruby extensively for some time, and having read this and some other articles about Crystal, I’m guessing (2) is well taken care of because of the aim of matching rspec functionality, and (4) by means of being Ruby-influenced. Not sure about (1).
I feel like the word “putter” has some connotations associated with it that make it misplaced in the article, though. I looked it up in the M-W dictionary and I think that the appropriate definition was the verb:
1: to move or act aimlessly or idly
2: to work at random: tinker
And the “especially” part of the definition of tinker has “unskilled or experimental manner” in it.
Experimental I can get behind. Organic, not necessarily pre-meditated, even. But unskilled? I think that is not what is being aimed at here. This is careful, painstaking work, with attention to details.
A minor quibble to be sure. I still don’t actually know what bearblog.dev is but it must be some kind of place for devs at small software shops to write about their work is my guess, based on the two or three posts I’ve read on the domain name. I’ve enjoyed them all so far.
Former 25+ cigarette a day smoker. It is an addiction and it may start in fun or on a lark, but it pervaded all areas of my life. Being in an airport for a layover and having to leave to smoke and come back through security is a shitty feeling. Running out of - or even running low on - cigarettes regularly created panic in me. I avoided many social activities and interactions because I didn’t want to have to either out myself as a smelly, disgusting smoker or else deprive myself for hours or more at a stretch. And the price has steadily gone up.
I did try vaping for a time and it was likely a better alternative than cigarettes. But the best, speaking from personal experience, is not having any dependency on nicotine at all. The psychological effects were so devastating for me. And as the article says, so many people die or have died of smoking related diseases. And it is a slow, drawn out process. It is an incredible shame and I am very happy that it is affecting a smaller portion of people than ever.
To me it was all about understanding the limitations, motivations, understandings, and abilities of our users or audience, and giving them a chance to get what they need with a minimum of fuss (thereby making our site/tool/whatever of maximum utility).
I want to say I’ll read the book now, but I’m not sure if that is true. (I a deliberately eliding a joke about my own satisficety for the sake of you, dear reader. :) ) I will bookmark this page and I expect that I will come back to it. In particular I liked the practical and useful plan for performing tests.
There is a difference in Go’s slices between length and capacity. Length is the number of elements in the slice, and capacity is the number of elements that can fit in the backing array (so len <= cap).