HackerTrans
TopNewTrendsCommentsPastAskShowJobs

nadaviv

997 karmajoined 14 anni fa
Bitcoin open-source contributor, Ambassador at Bitcoin Embassy TLV

[email protected]

GPG: FCF1 9B67 8665 62F0 8A43 AAD6 81F6 104C D0F1 50FC

https://github.com/shesek

https://twitter.com/shesek

https://www.bitrated.com/nadav

https://keybase.io/nadav

[ my public key: https://keybase.io/nadav; my proof: https://keybase.io/nadav/sigs/fidZAcOG85AA92vZM5f8WYFciFMvBPhZdMQ71gX3hBw ]

Submissions

GPT3 'make things up as you go'-driven development

twitter.com
9 points·by nadaviv·4 anni fa·1 comments

comments

nadaviv
·11 giorni fa·discuss
I really enjoyed Crafting Interpreters by Robert Nystrom and found it valuable for the development of a DSL I'm working on.

From https://craftinginterpreters.com/:

> Crafting Interpreters contains everything you need to implement a full-featured, efficient scripting language. You’ll learn both high-level concepts around parsing and semantics and gritty details like bytecode representation and garbage collection. Your brain will light up with new ideas, and your hands will get dirty and calloused. It’s a blast.

The book is available for free on the website: https://craftinginterpreters.com/contents.html
nadaviv
·3 anni fa·discuss
While somewhat lengthy, I found this post to be a great resource for learning about async and epoll: https://ibraheem.ca/posts/too-many-web-servers/

It starts with a simple single-request-at-a-time HTTP server implemented in Rust, then progresses to examples with multi-threading, non-blocking, epoll-based multiplexing, futures and async/await, showing the limitations and advantages at each step.

Previous discussion: https://news.ycombinator.com/item?id=37176960
nadaviv
·3 anni fa·discuss
Wait what? Propaganda? I really don't get why this is invoking such strong reactions...
nadaviv
·3 anni fa·discuss
Why is it insulting to point out that GPT can produce good results for this particular use-case?

Being able to define your argument types and generate parsing code for them using an example CLI invocation feels very natural and expressive to me. I personally found it to be useful for my work.
nadaviv
·3 anni fa·discuss
GPT is pretty good at figuring out argument parsing code based on example CLI usage. Like this:

    > Write bash code to parse the following arguments:
    >
    > $ ./export.sh --out-file dump.json --db foo.sqlite --include-headers --exclude-rev -vvv -p9000

    Here's an example bash code to parse the arguments:

    #!/bin/bash

    # Default values for optional arguments
    INCLUDE_HEADERS=false
    EXCLUDE_REV=false
    VERBOSE_LEVEL=0
    PORT=0

    # Parse the arguments
    while [[ "$#" -gt 0 ]]; do
        case $1 in
        --out-file) OUT_FILE="$2"; shift ;;
        --db) DB="$2"; shift ;;
        --include-headers) INCLUDE_HEADERS=true ;;
        --exclude-rev) EXCLUDE_REV=true ;;
        -v) VERBOSE_LEVEL=$((VERBOSE_LEVEL+1)) ;;
        -p) PORT="$2"; shift ;;
        -h|--help) 
            echo "Usage: ./export.sh [OPTIONS]"
            echo ""
            echo "Options:"
            echo "--out-file     Output file path (required)"
            echo "--db           Database path (required)"
            echo "--include-headers  Include column headers in output (default: false)"
            echo "--exclude-rev   Exclude revisions in output (default: false)"
            echo "-v              Increase verbosity level (default: 0)"
            echo "-p              Port number (default: 0)"
            echo "-h, --help      Show help"
            exit 0
            ;;
        *) echo "Unknown parameter passed: $1"; exit 1 ;;
        esac
        shift
    done

    # Check required arguments
    if [[ -z $OUT_FILE ]]; then
        echo "Error: missing argument --out-file"
        exit 1
    fi

    if [[ -z $DB ]]; then
        echo "Error: missing argument --db"
        exit 1
    fi

    # Print parsed arguments
    echo "OUT_FILE=$OUT_FILE"
    echo "DB=$DB"
    echo "INCLUDE_HEADERS=$INCLUDE_HEADERS"
    echo "EXCLUDE_REV=$EXCLUDE_REV"
    echo "VERBOSE_LEVEL=$VERBOSE_LEVEL"
    echo "PORT=$PORT"
nadaviv
·3 anni fa·discuss
It might be harder to detect if you open it as a separate window instead of docking it to the bottom/side of the window.
nadaviv
·4 anni fa·discuss
TL;DR: just pretend some code repo exists, interact with it, and GPT will happily fill in the blanks.

Example:

    # Start with the "act as a terminal" preface (https://github.com/f/awesome-chatgpt-prompts#act-as-a-linux-terminal)

    git clone https://github.com/shesek/veterinarian-app
    cd veterinarian-app

    node src/webserver.js --port 5051

    curl -X POST localhost:5051/api/customers/create -d name='Bob Marlin' -d phone=050-1112223 -d [email protected]

    curl localhost:5051/api/customers?fields=id,uri,name,phone,email,created_at,updated_at,num_animals,next_visit

    # src/webserver.js will now exists with an implementation of the API endpoints.

    ./util/db-dump-json.sh --include customers,animals --out-file dump.json

    # db-dump-json.sh will now exists, including argument parsing/validation and usage help text.
The twitter thread lists some more examples. It's pretty mind blowing to me that this is possible!
nadaviv
·5 anni fa·discuss
They could've created a federated SGX-based model on top of any of the existing cryptocurrencies. The only reason for them to invent a new one is making $$$.
nadaviv
·5 anni fa·discuss
100% of it is premined.
nadaviv
·6 anni fa·discuss
lol, what? This is not how things work in Ethereum. The foundation has the authority to do anything it wants, despite the community's wishes. The DAO bailout hard fork showed that very well.
nadaviv
·6 anni fa·discuss
> The overjustification effect occurs when an expected external incentive such as money or prizes decreases a person's intrinsic motivation to perform a task. Overjustification is an explanation for the phenomenon known as motivational "crowding out." The overall effect of offering a reward for a previously unrewarded activity is a shift to extrinsic motivation and the undermining of pre-existing intrinsic motivation. Once rewards are no longer offered, interest in the activity is lost; prior intrinsic motivation does not return, and extrinsic rewards must be continuously offered as motivation to sustain the activity.

https://en.wikipedia.org/wiki/Overjustification_effect
nadaviv
·6 anni fa·discuss
Source?