Comment by sam_

4 years ago

Just tried the same but telling ChatGPT to be an Emacs Lisp Interpreter. The results are very impressive in my opinion.

  > (let (test "I'm a blue whale")  
  > (message (format "%s" test)))

I'm a blue whale

  > (setq humans '(Joe Anna David)))

(nothing shown as expected)

  > (defun print-elements-of-list ....)  
  > (print-elements-of-list humans)

Joe Anna David

  > {make a boilerplate emacs package and show me the code}

[valid boilerplate]

  > {show me the code to create a completion at point function}

[a good looking piece of code that could help me code a custom completion function!]

Ditto for a SQL Database. I am blown away by this.

> I want you to act as a SQL database. I will type commands and you will reply with what the database should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. Do no write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curl brackets {like this}. My first command is `SELECT 1`.

  1

> SHOW DATABASES

  Error: No databases exist.

> CREATE DATABASE gpt

  Database created successfully.

> USE gpt

  Database changed.

> CREATE TABLE TestTable AS SELECT 1234 AS 'col1'

  Table created successfully.

> SELECT * FROM TestTable

  col1
  1234

> SELECT COUNT(*) FROM TestTable

  1

> DELETE FROM TestTable WHERE 1 = 0

  0 rows deleted.

> SELECT * FROM TestTable

  col1
  1234

> DELETE FROM TestTable WHERE 19 > 1

  1 row deleted.

> SELECT * FROM TestTable

  Error: Table not found.

  • And a Python 3 REPL:

    > I want you to act as a python3 REPL. I will type commands and you will reply with what the REPL should show. I want you to only reply with the REPL output inside one unique code block, and nothing else. Do no write explanations. Do not type commands unless I instruct you to do so. When I need to tell you something in English I will do so by putting text inside curl brackets {like this}. My first command is: print("hello world")

      hello world
    

    import sys; print(sys.version)

      3.7.2 (default, Dec 29 2019, 22:12:53)
      [GCC 8.3.0]
    

    355/113

      3.1415929203539825

  • That's very impressive. Using commands like:

    > {show data in the foo table as csv}

    > {show data in the foo table as json}

    > {show data in the foo table as yaml}

    It'll even fulfill those requests.

    Using a similar prompt to your original I got it to act as a MongoDB database as well. Then took it a step further and asked it to generate SQL INSERT statements and a CREATE TABLE statement for the MongoDB data.

    I could get it to give me incorrect results if I made my query complicated enough, but man, it's almost scary how good it is.

    All that said, definitely the slowest response times I've ever had for tables/collections that small :)