Giter Club home page Giter Club logo

praxis-ide's Introduction

About

Praxis is/ strives to become, an online IDE for visual programming in Prolog. It is (currently) a 100% in-browser application, meaning that there is no component running on any server. -You can just download the repo and run it from your local file system, without any build-steps or other preparations.

Server component will be added as an optional feature in the future (for example, allow users to log in and store their models online, for easy sharing and integration/ publishing), but I will strive to maintain the advantage of having a system that is useful also without any specific server running.

Praxis uses Tau-Prolog to allow you to run/ test models in the browser.

An image of a Praxis example

Released under the MIT license.

Online Tutorials
Brief instructions for using the IDEA Praxis "model" is the same as the entire project - it's what we will load, save and edit with the Praxis IDE.

General about the UI
  • Add/ delete/ rename project pages/ tables/ folders by right-clicking a node in the tree-menu, and selecting the appropriate action
  • Reorder nodes in the tree-menu by drag-and-drop
  • Click any item in the tree-menu to view and edit it.
  • Load and Save models to your local machine, with the Upload and Download buttons on the top right
  • You can hide/show the different panels that make up the UI, by clicking on their (darker) mid-bar, or by using Ctrl-ArrowButtons.
Model creation and Settings
  • Create a new model by loading/ reloading the page - you will arrive at the "Settings" page
  • Give the model a name in the Name box (will decide file-name)
  • Under "Standard Tau-Prolog libraries", mark the ones you want to use
  • When on another page, reach this "Settings"-page by clicking the project name-node in the tree-menu
Editing drawings
  • Create a new drawing-page by right-clicking its desired location in the tree-menu, and selecting "Add rules page" (the select the page in the tree, if not already done)
  • Drag shapes from the palette, and edit their contents in the side-panel
  • Click empty space to deselect shape, and view palette
  • Connect shapes by dragging from their bottom, to the top of the shape you want to be evaluated afterwards
  • Toggle connection function between "AND THEN" and "OR ELSE" by right-clicking them
  • Delete shapes and connections by marking them and pressing Delete
  • Mark one/several shapes and copy/ paste them, with Ctrl-C and Ctrl-V
  • Pan by moving the mouse with RMB (Right Mouse Button) pressed
  • Zoom by rolling the mouse-wheel with RMB pressed
Executing rules
  • Select the Test-tab in the bottom panel
  • Enter a query and press Query, in order to execute that query. A query must end with a "." (full stop)
  • Press Next to see if there is more than one possible result
  • Press Reset to compile/ recompile your code from the model - OTHERWISE you will not get your updated code from changes in the model(!)
  • Set Execution limit to decide how many levels of calls you want to allow (limits the risk of endless recursions)
  • Editing tables
    • Create a new table by right-clicking its desired location in the tree-menu, and selecting "Add data table" (the select the table in the tree, if not already done)
    • Give the table a better name than the default-generated one, in the side panel (best if this is a Prolog Atom - starts with lowercase letter, containing only alphanumeric characters or "_" (underscore))
    • Decide what number of columns you want, with the [+] and [-] buttons
    • Decide data-type for each column, and give them good names
    • Add new row by adding something in the lowermost row, and pressing Return
    • If you change the number of columns in a table that you are using in a drawing, you must go to the table-referring shape, select it and press Ok to get the new (correct) number of columns.
    Files
    • Load and Save models to your local machine, with the Upload and Download buttons on the top right
    • Download Prolog code / Tau-Prolog js-package generated from your model, by going to the Files-tab in the bottom panel, and clicking "Download" (Prolog code) or "Download module" (Tau-Prolog js-package)

    Current state

    Version 0.1.0 is available to run here, in your browser: https://toblotron.com/praxis/0.1.0/

    You can

    • Create models, and store them locally on your on machine.
    • Draw rules (using shapes representing different Prolog statements)
    • Edit tabular data in Excel-like pages.
    • Run / ask questions to your model, directly in the browser.
    • Import libraries (WIP) from URL's, and use the (Tau-Prolog) code therein.

    Goals for next version (0.2.0)

    • Introduction of pratt-parser, and generation of an intermediate Abstract Syntax Tree before code generation, allowing better control over parsing and generation of error-messages. (60% ready)
    • Handling schema-defined types, (editing, importing from schema, using specialized shapes to process structured data) allowing handy integration of your logic models through (for example) a REST-service interface. (10% ready)
    • Creating developer documentation, for easier understanding of what the system is and how the different parts work together. Documentation is kind of a thing of mine, so I am ambitious about this. (20% ready)

    Praxis website

    Praxis is hosted on https://toblotron.com/praxis/ - it contains a resource overview page, the web-app and a blog where interesting developments are sometimes announced.

    Installation

    You do not need to install the Praxis IDE - either run it in the browser, or download this repo and run it from your local machine. It's that simple.

    Contributions

    Contributions are very welcome - in fact, version 0.1.0 has been developed with the goal of attracting other interested parties in mind. This is too big to be a feasible single-developer project.

    This is a reason that creating developer documentation has a high priority.

    Not only coders need apply - I would love to hear what ideas others have about Praxis; possible feature, how things could work/ look, integrations, etc.

    PS: I am kind of new to both GitHub and the JavaScript world - I am aware it is very likely that there are better ways of doing things, and suggestions are very welcome :)

    praxis-ide's People

    Contributors

    johnblood avatar kungfooman avatar toblotron avatar

    Stargazers

     avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

    Watchers

     avatar  avatar  avatar  avatar

    praxis-ide's Issues

    Ciao prolog integration

    How could an integration with ciao prolog work? There are versions of Ciao Prolog that run as WASM modules, which should be able to work as execution environment for the prolog code generated by the Praxis IDE.

    Make a simple example web page where

    • Prolog code can be executed, and answers returned from Ciao Prolog.
    • Dependencies can be handled, in some way: other libraries that are needed by the entered code can be supplied to the ciao prolog execution environment.

    Bonus: Other interesting thing to explore could be whether it's possible to break execution and pause it, notifying the overlying JavaScript environment (for example in order to perform live debugging) and then resume execution at will.

    Make ruleExpression to keep Rules in AST

    We aren't parsing Rules from text yet, with the pratt parser, but we still need an expression to keep them

    Will be harvested from shape data, at this stage - not text

    Usability: add buttons or toolbar for actions

    First of all congratulations on the project, it's a good idea. Second, it took me a while to figure out that to add a rule page I had to right click on the folder. Maybe it's just me (or the fact I haven't used prolog in a while) but I think a toolbar for actions you can do by right clicking on a folder could be useful. Or maybe just a description of actions you can do in the README.

    SWI-prolog integration

    How could an integration with SWI-prolog work? There are versions of SWIProlog that run as WASM modules, which should be able to work as execution environment for the prolog code generated by the Praxis IDE.

    Make a simple example web page where

    • Prolog code can be executed, and answers returned from SWI-Prolog.
    • Dependencies can be handled, in some way: other libraries that are needed by the entered code can be supplied to the SWI-prolog execution environment.

    Bonus: Other interesting thing to explore could be whether it's possible to break execution and pause it, notifying the overlying JavaScript environment (for example in order to perform live debugging) and then resume execution at will.

    Open newly created resource

    When creating a new drawing/table page, that page should immediately become selected, and it should be marked in the tree-menu

    Error message link to resource malfunctioning

    When you get an error message you are supposed to be able to click it, and immediately be transported to the page and shape that the message concerns.

    This malfunctioned in the following case:

    • use a table shape
    • go to the page of the table and change the number of columns
    • do not leave the table page
    • press Reset to generate code
    • you get an error-message saying there's a table shape that uses the wrong number of arguments for the table
      -click it
    • error: you do not get transported to the drawing page, like you should

    Recommend Projects

    • React photo React

      A declarative, efficient, and flexible JavaScript library for building user interfaces.

    • Vue.js photo Vue.js

      ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

    • Typescript photo Typescript

      TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    • TensorFlow photo TensorFlow

      An Open Source Machine Learning Framework for Everyone

    • Django photo Django

      The Web framework for perfectionists with deadlines.

    • D3 photo D3

      Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

    Recommend Topics

    • javascript

      JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

    • web

      Some thing interesting about web. New door for the world.

    • server

      A server is a program made to process requests and deliver data to clients.

    • Machine learning

      Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

    • Game

      Some thing interesting about game, make everyone happy.

    Recommend Org

    • Facebook photo Facebook

      We are working to build community through open source technology. NB: members must have two-factor auth.

    • Microsoft photo Microsoft

      Open source projects and samples from Microsoft.

    • Google photo Google

      Google โค๏ธ Open Source for everyone.

    • D3 photo D3

      Data-Driven Documents codes.