Gambit

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
(指南)
(指南)
 
(未显示1个用户的12个中间版本)
第1行: 第1行:
 
{{SeeWikipedia|Gambit (scheme implementation)}}
 
{{SeeWikipedia|Gambit (scheme implementation)}}
  
Gambit 是 [[Scheme]] 开源实现,可用于移动和嵌入式开发。
+
Gambit
 +
 
 +
[[文件:gambit-logo.png|right]]
 +
==简介==
 +
Gambit 是 [[Scheme]] 开源实现,可用于移动([[iOS]], [[Android]])和嵌入式开发。
 +
 
 +
==功能==
 +
*Fast: Gambit is one of the fastest dynamic language implementations.
 +
*Portable: Targets C, JavaScript, Python, and more.
 +
*Concurrent: Millions of lightweight threads on a server.
  
 
==指南==
 
==指南==
下载二进制安装包,如:[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.8/prebuilt/gambit-v4_8_5-macosx-intel64.dmg OS X版]
+
Debian
 +
$ sudo apt install gambc
 +
 
 +
或下载二进制安装包,如:[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.8/prebuilt/gambit-v4_8_5-macosx-intel64.dmg OS X版]
 +
$ gsi -e "(pretty-print (expt 2 100))"
 +
1267650600228229401496703205376
 
  $ gsi
 
  $ gsi
 
  Gambit v4.8.5
 
  Gambit v4.8.5
 
 
  > (define (fact n) (if (< n 2) 1 (* n (fact (- n 1)))))
 
  > (define (fact n) (if (< n 2) 1 (* n (fact (- n 1)))))
 
  > (map fact '(1 2 3 4 5 6))
 
  > (map fact '(1 2 3 4 5 6))
第15行: 第28行:
 
  815915283247897734345611269596115894272000000000
 
  815915283247897734345611269596115894272000000000
 
  > ,q
 
  > ,q
 +
$ cat h.scm
 +
(display "hello") (newline)
 +
$ cat w.six
 +
display("world"); newline();
 +
$ gsc -o hello.exe -exe h.scm w.six
 +
h.scm:
 +
/home/huihoo/Software/lisp/gambit/h.c:
 +
w.six:
 +
/home/huihoo/Software/lisp/gambit/w.c:
 +
/home/huihoo/Software/lisp/gambit/w_.c:
 +
$ ./hello.exe
 +
hello
 +
world
 +
$ gsc -c h.scm
 +
$ gsc -c w.six
 +
$ gsc -o hello.exe -exe h.c w.c
 +
$ gsc
 +
> (compile-file-to-target "h")
 +
"/home/huihoo/Software/lisp/gambit/h.c"
  
==链接==
+
卸载 gambit
 +
sudo uninstall-gambit v4.8.5
 +
 
 +
==应用==
 +
*[[LambdaNative]]
 +
 
 +
==图集==
 +
<gallery>
 +
image:gambit-v4.8.5.png|Gambit
 +
image:Gambit-REPL.jpeg|REPL
 +
</gallery>
  
 
==链接==
 
==链接==
 
*[http://gambitscheme.org Gambit官网]
 
*[http://gambitscheme.org Gambit官网]
 
*[https://github.com/feeley/gambit Gambit @ GitHub]
 
*[https://github.com/feeley/gambit Gambit @ GitHub]
*[http://docs.huihoo.com/gambit Gambit文档]
+
*[https://docs.huihoo.com/lisp/gambit/ Gambit文档]
  
 +
[[category:mobile]]
 +
[[category:embedded system]]
 
[[category:scheme]]
 
[[category:scheme]]
 +
[[category:lisp]]
 
[[category:iOS]]
 
[[category:iOS]]
 
[[category:android]]
 
[[category:android]]
 +
[[category:Huihoo Foundation]]

2022年1月28日 (五) 07:04的最后版本

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Gambit Thanks, Wikipedia.

Gambit

Gambit-logo.png

目录

[编辑] 简介

Gambit 是 Scheme 开源实现,可用于移动(iOS, Android)和嵌入式开发。

[编辑] 功能

  • Fast: Gambit is one of the fastest dynamic language implementations.
  • Portable: Targets C, JavaScript, Python, and more.
  • Concurrent: Millions of lightweight threads on a server.

[编辑] 指南

Debian

$ sudo apt install gambc

或下载二进制安装包,如:OS X版

$ gsi -e "(pretty-print (expt 2 100))"
1267650600228229401496703205376
$ gsi
Gambit v4.8.5
> (define (fact n) (if (< n 2) 1 (* n (fact (- n 1)))))
> (map fact '(1 2 3 4 5 6))
(1 2 6 24 120 720)
> (values (fact 10) (fact 40))
3628800
815915283247897734345611269596115894272000000000
> ,q
$ cat h.scm
(display "hello") (newline)
$ cat w.six
display("world"); newline();
$ gsc -o hello.exe -exe h.scm w.six
h.scm:
/home/huihoo/Software/lisp/gambit/h.c:
w.six:
/home/huihoo/Software/lisp/gambit/w.c:
/home/huihoo/Software/lisp/gambit/w_.c:
$ ./hello.exe 
hello
world
$ gsc -c h.scm
$ gsc -c w.six
$ gsc -o hello.exe -exe h.c w.c
$ gsc
> (compile-file-to-target "h")
"/home/huihoo/Software/lisp/gambit/h.c"

卸载 gambit

sudo uninstall-gambit v4.8.5

[编辑] 应用

[编辑] 图集

[编辑] 链接

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱