Giter VIP home page Giter VIP logo

go-spark's Introduction

Go+Ada SPARK Example

This is an example program for how to interface a Go program with Ada SPARK 2014 functions by using cgo as described here. This uses the example binary_search SPARK example with only a single pragma Export added.

Usage

In order to run this example you will need a working Go environment, Ada (with gnat libraries), and Ada SPARK.

To run proofs, compile Ada libraries, and compile the Go binary run:

make

The proof output will be generated into ./gnatprove/gnatprove.out and the spark_test go binary will be created from the goexample.go source.

This example includes cexample.c that can be used as an example to link Ada SPARK programs into C. Create the C spark_test binary with:

make c

Clean up with:

make clean

Workflow

  1. Export SPARK function to C:
  2. Prove Ada code: gnatprove
  3. Compile Ada code to object file: gnatmake
  4. Create static archive (you could use the .o directly at link time as in the C example): ar rc
  5. Compile Go: go build

go-spark's People

Contributors

terrorbyte avatar

Stargazers

Tomek Wałkuski avatar Alexander Senier avatar JK avatar Chen avatar Stephen Walker-Weinshenker avatar Noah Cain avatar

Watchers

James Cloos avatar  avatar

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.