1About this page

This page is about big plans/ideas, prioritization, and effort estimation (may be wrong).

This page is the most important page in this wiki. This page directs the wiki.

2Goals I'm unsure of

2.1Things that I perhaps should do

2.1.1TODO <2018-09-15> Fix possible programming error in ~/work/web in Iterables.filter

2.1.2TODO Ask others

  1. Who should we ask?

    • Haskell Cafe mailing list
    • #haskell on freenode IRC
    • Haskell reddit
    • Abdullah
  2. TODO <2018-09-17> Is there anything like Pandoc but for programming languages instead of markup languages?

    <2018-12-14> Yes, it's called "universal transpiler". It's a Prolog project. It's far from done though. This is like pandoc but for programming languages instead of markup languages.

    https://www.quora.com/Is-there-a-program-which-converts-code-written-in-one-programming-language-to-code-in-another-programming-language

    Does anyone know of anything like Pandoc but for programming languages?

    For example, it would translate Haskell to Java by translating Haskell into an internal representation and then translating that internal representation to Java.

    Possible related things:

    • LLVM IR
    • GHC Core

    A person can convert a code in programming language L to an "equivalent" code in programming language M. This implies that there is a common semantics between L, M, and the language of thought. How do we write programs directly in language of thought? Logic is the language of thought? The 10 most used human language contains first-order logic.

2.2What if my Prolog honeymoon is over?

2.2.1Write a Prolog program to interpret or translate Java source code

2.2.2Describe a probabilistic graphical model as prolog knowledge base, and do Pearl causal calculus on them.

Causal calculus in prolog?

See also ProbLog: probabilistic logic programming in Prolog.

2.2.37d: Write a planner in Prolog

A plan is a list of items.

An item is either a group or a task.

A group has a title and zero or more children. The title is an atom. Each child is an item.

A task has a title, a start date estimation, an effort estimation in person-hours, actual start date (inclusive), and actual end date (exclusive).

Example plan in Prolog: The canonical form:

[
    group('build house', [
        task('lay bricks', _, 40, _, _)
    ])
]

Almost-Haskell syntax

[
    group 'build house' [
        task 'lay bricks' 40 _,
        task 'put roof' 40 _,
    ],
]

Lisp syntax

(group 'build house' (
    (task 'lay bricks' 40 _)
    (task 'put roof' 40 _)
))

Types

type Group = Title * [Child]
type Child = Group | Task
type Task = Title * Estimate
type Estimate = Person_hour

2.2.4Enterprise Prolog?

  1. 14d: translate Java source to abstract procedural language in Prolog

    • 7d: model Java lexicon and syntax in Prolog
    • 7d: Translate Java class to Prolog record + predicate

    Only allow synchronized(F) in class C iff:

    • F is a private final instance field of C
    • The type of F is java.lang.Object
    • F is immediately initialized with new java.lang.Object()

    Example: private final Object lock = new Object();

  2. others

    • 7d: Send email from Prolog with …
    • 7d: Design Profon, write it in proton.pro
    • 1d: Profon eval_strict(?Exp, ?Res), eval_lazy(?Exp, ?Res)
    • 1d: Import from information_schema.tables
  3. Prolog SQL

    • 7d: Prolog functional query language abstraction over SQL database

    Prolog null/undefined/omitted/not_loaded/z?

    Nobody has done ODBC connection pooling in Prolog. http://swi-prolog.996271.n3.nabble.com/ODBC-connection-pooling-td4396.html But we may not have to, because unixODBC has done that? http://www.unixodbc.org/doc/conn_pool.html But it suggests that perhaps we should not use pooling.

    "The meta predicates of this library modify the sequence of solutions of a goal. The modifications and the predicate names are based on the classical database operations DISTINCT, LIMIT, OFFSET, ORDER BY and GROUP BY." http://www.swi-prolog.org/pldoc/doc/_SWI_/library/solution_sequences.pl

    From the same description, Prolog should generate all of these:

    • Java class for volatile storage, and
    • Java code for persistent storage using JDBC.

    http://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/cql.html%27) Prolog SQL cql Two approach: Map database table to prolog predicate Or Map query to term, design a dsl

    Option 2 is easier It is easier to write a Prolog-backed cql storage than to write a Prolog program transforming a Prolog program to another Prolog program

    column/5

    /* sql_information_schema__column/6 */ sql_information_schema__column(Database, Schema, Table, Name, Type, Nullable)

    variable name read_term have variable_names option

    Cognitive problem: predicate too long database_schema_table_column_type_nullable/6

    https://stackoverflow.com/questions/8172687/is-there-a-way-to-translate-database-table-rows-into-prolog-facts http://www.swi-prolog.org/pldoc/man?section=strings

    /* This relates a table name to its referent. */ table_database_schema_name(T, D, S, N)

    database_schema_table_column_type

    column_type(column(Database, Schema, Table, Name), Type)

    table_column_type(Table, Column, Type)

    table_column_nullable(T, C)

    http://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/cql.html%27) Prolog SQL cql Two approach: Map database table to prolog predicate Or Map query to term, design a dsl

    Option 2 is easier It is easier to write a Prolog-backed cql storage than to write a Prolog program transforming a Prolog program to another Prolog program

    column/5

    /* sql_information_schema__column/6 */ sql_information_schema__column(Database, Schema, Table, Name, Type, Nullable)

    variable name read_term have variable_names option

    Cognitive problem: predicate too long database_schema_table_column_type_nullable/6

    https://stackoverflow.com/questions/8172687/is-there-a-way-to-translate-database-table-rows-into-prolog-facts http://www.swi-prolog.org/pldoc/man?section=strings

    /* This relates a table name to its referent. */ table_database_schema_name(T, D, S, N)

    database_schema_table_column_type

    column_type(column(Database, Schema, Table, Name), Type)

    table_column_type(Table, Column, Type)

    table_column_nullable(T, C)

    Prolog-SQL mapping?

    Table(P) means that P models a row stored in the table that Table models.

    :- small TABLE 30.

    Create TABLE(Key, Row). Load on-demand.

    force(TABLE(Key, Row)) runs SQL update and invalidates the table. Bulk copy into RAM.

    :- big TABLE(Key, Row). Load on-demand. Keys must be ground. Maintain cursor.

    Translate a Prolog fragment to SQL-involving Prolog fragment.

    Write your program as if all the data were in Prolog RAM?

2.2.5Write a language suite in Prolog: write C and Haskell parser, interpreter, and compiler?

3Goals achieved or obviated

3.1DONE <2018-09-15> Modernize operating system

3.1.1TODO move to usecom

Write the experiences in usecom.

<2018-12-21> I installed Debian 9.6. I left Ubuntu 14.04.5.

3.1.21d: Back up data.

Should not take more than a day. What takes a long time is determining what needs to be backed up.

3.1.3TODO 1d: Install Ubuntu 18.04 after its point release Debian

Ubuntu 14.04 EOL is April 2019.

<2018-10-26> I'm using Ubuntu 14.04.

When Ubuntu 14.04 reaches its end of life, I'll move to Debian. I won't upgrade to Ubuntu 18.04.

3.1.4OS upgrade

Needed: apt/dpkg check all modified files. https://serverfault.com/questions/90400/how-to-check-for-modified-config-files-on-a-debian-system

"People will recommend [Debian] 'testing' to you but I would advise against it…" https://news.ycombinator.com/item?id=7076601

The most important thing distros give us is precompiled binaries for libraries. This greatly simplifies building a C program with lots of dependencies. There are too many build systems for C. C build system is counterproductively fragmented. The truth is, building a C program is as simple as "cc *.c", if there are no dependencies.