GithubHelp home page GithubHelp logo

cl-gi's Introduction

Cl-GIR

This is my attempt at building automatic binding generation based on the .gir files from Gobject introspection. It is currently by no means complete, it doesn't even attempt to load object information yet. But I wanted to share it with anyone who finds it, and have a backup available in the event my computer explodes.

Requirements

You can peek at cl-gir.asd for the most up-to-date information, but as of now, it depends on

  • cffi
  • alexandria
  • xmls
  • split-sequence

which you can install by running

(loop for package in '("cffi" "alexandria" "xmls" "split-sequence")
	do (ql:quickload package))

at your REPL. You'll also need some gir libraries installed. cl-gir will look in /usr/share/gir-1.0/.

How to use it

Right now, fire up your lisp and follow me! I'll show a few short things

(require 'cl-gir)

(cl-gir:load-repository "GLib" "2.0")

As things currently stand, this will result in your lisp telling you about all the things it doesn't know how to parse, and a bunch of things about constants, aliases, and functions, which it does. When it finishes, you should be able to do things like this:

CL-USER> (GLib:ascii-strup "cart" -1)
"CART"
CL-USER> (GLib:random-double)
0.9164995134550389d0
CL-USER> (format nil "This code calls glib version ~d.~d" GLib:+MAJOR-VERSION+ GLib:+MINOR-VERSION+)
"This code calls glib version 2.29"
CL-USER> (cffi:with-foreign-pointer-as-string (s 128)
   (GLib:sprintf s "Here's a number %g, and a char %c" :double 34.21d3 :char 78))
"Here's a number 34210, and a char N"
CL-USER> (cffi:with-foreign-pointer-as-string (s 128)
   (GLib:sprintf s "Here's a number %g, and a char %c" :double 34.21d3 :char 78))
"Here's a number 34210, and a char N"

Ok, now if you'll excuse me, I have a lot more code to write for this...

cl-gi's People

Contributors

fisxoj 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.