GithubHelp home page GithubHelp logo

thoughtpolice / cryptol-mode Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 6.0 72 KB

A Cryptol major mode for Emacs.

Home Page: https://www.cryptol.net

License: GNU General Public License v3.0

Emacs Lisp 97.42% Makefile 2.58%

cryptol-mode's Introduction

The birds have vanished down the sky.

Now the last cloud drains away.

We sit together, the mountain and me,

until only the mountain remains.

Zazen on Ching-t’ing Mountain

cryptol-mode's People

Contributors

david-christiansen avatar thoughtpolice avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

cryptol-mode's Issues

Emacs 23 support.

We don't support Emacs 23 because it doesn't provide prog-mode. We should just derive from fundamental-mode instead I think.

I have an incoming patch for this; the ticket is just for tracking.

M-; prompts for comment syntax

M-; doesn't presently work the way I'd expect.

Expected behavior: I highlight a bit of text, and M-; comments it out

Observed behavior: I'm prompted for a comment syntax, after which M-; works.

Support for inserting inferred function types

Given a function definition, it'd be excellent if we could insert the functions inferred type signature much like haskell-mode and ghc-mod can.

This should be fairly simple in principle by invoking the compiler and just asking for the type (ghc-mod gets the benefit of being integrated via the GHC API;) for example (by default this will do bit interpretation, supporting all of Cryptol):

$ cat > test.cry
zip (a,b) = [| (x,y) || x <- a || y <- b |];
$ cryptol -qns test.cry -c ":type zip"
zip : {a b c d} ([a]b,[c]d) -> [min(a,c)](b,d)
$

Or:

$ cryptol -qns test.cry -c ":type dkatest"
dkatest : {ks bs n} (fin bs) => ({decrypt : ([ks],[bs]) -> [bs];
                                  encrypt : ([ks],[bs]) -> [bs]},
                                 [n]([ks],[bs],[bs])) -> [n]([bs],Bit)

Another question is what keybinding should be used. I am actually partial to M-t, which I picked up as a habit from ghc-mod. The original C-u C-c C-t used by haskell-mode could also work as well, but it's a bit longer. :)

Compile to Isabelle easily.

This might be complicated due to the fact I don't know how to get the Isabelle theories publicly; Galois must provide them.

cryptol-mode REPL contains unwanted control codes

When launching the REPL in cryptol-mode on a new file, I get the following errors:

                        _        _
   ___ _ __ _   _ _ __ | |_ ___ | |
  / __| '__| | | | '_ \| __/ _ \| |
 | (__| |  | |_| | |_) | || (_) | |
  \___|_|   \__, | .__/ \__\___/|_|
            |___/|_| version 2.1.0 (faab3ae)

�]0;cryptol��]0;cryptol�[error] can't find file: /Users/dchristiansen/tmp/Test.cry
cryptol> 
cryptol> 
Process cryptol finished
xo                        _        _
   ___ _ __ _   _ _ __ | |_ ___ | |
  / __| '__| | | | '_ \| __/ _ \| |
 | (__| |  | |_| | |_) | || (_) | |
  \___|_|   \__, | .__/ \__\___/|_|
            |___/|_| version 2.1.0 (faab3ae)

�]0;cryptol��]0;cryptol�Parse error at 3:1, unexpected end of input
cryptol> 

Github isn't showing the ^G characters that are also in it. Shouldn't these be stripped out?

Compiler mode switching.

Includes things like C, SBV, VHDL, etc.

This is not directly related to the compiler tickets; this is only for quickly switching, since users might want to switch to refine theories in other backends.

This also might just be an easy stop gap to provide users now, and later we use it to switch mode+invoke compiler all at once easily.

REPL is broken on Linux

On my Ubuntu 12.10 machine, cryptol-mode is broken due to (I believe) incorrectly detected $TERM settings. When you launch the terminal, any keystrokes will cause cryptol to immediately exit. This is obviously a very bad bug.

Launching the REPL on my OS X machine Emacs correctly seems to set $TERM to dumb, and the REPL works just fine for playing around. It also does this for Linux, but it seems as if terminfo (which the cryptol executable is linked to) always reports that it cannot find the dumb mode despite having all the prerequisite packages installed.

I'll try to provide more details shortly but I realized I hadn't filed this.

Compile to C easily.

We should support both the C backend and translation via the (IMO much nicer) sbv backend.

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.