recki-ct

  • 所有者: google/recki-ct
  • 平台:
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Recki-CT

Build Status
Coverage Status

The Recki Compiler Toolkit for PHP

Disclaimer: This is not an official Google product.

Warning: This is an incomplete work-in-progress.

Stability

Recki-CT is pre-alpha quality right now. This means that it shouldn't be used in production at all.

What Is Recki-CT?

Recki-CT is a set of tools that implement a compiler for PHP, and is written in PHP!

Specifically, Recki-CT compiles a subset of PHP code. The subset is designed to allow a code base to be statically analyzed. This means that global variables, dynamic variables (variable-variables, variable function calls, etc) and references are not allowed.

What Isn't Recki-CT?

Recki-CT is not a re-implementation of PHP. It aims to be a limited subset of the language (one that can be staticly reasoned about).

This means that it is not designed to replace PHP, but instead augment it.

Why?

PHP itself isn't slow. It's plenty fast enough for most use-cases. As a language, PHP has a lot of corner cases and results in a
really complex engine implementation. As such, rewriting a new engine isn't going to gain you a lot. The complexity is going to
be in there somewhere.

So with Recki-CT, we take a different approach. Rather than rewriting the entire engine, we sit on top of an existing engine. The compiler
then can compile PHP code into native machine code which can out-perform most JIT compiled implementations (sometimes by very significant margins).

The designed mode of operation for Recki is as an AOT (Ahead-Of-Time) compiler. Since it uses aggressive analysis and optimizations,
runtime compilation would be a inefficient target. Instead, an Intermediate Representation can be cached, leaving only the final conversion
to machine code to happen at runtime.

Where can I find out more?

Check out the documentation!!!

  1. Introduction and FAQ
  2. Installation
  3. Basic Operation
  4. Types
  5. Intermediate Representation

How do I install Recki-CT?

See the Installation Documentation.

How do I use Recki-CT?

A very simple example:

/**
 * @return void
 */
function foo($bar) {}

// Instead of using:
foo($baz);

// Use:
$foo = Jit::JitFu('foo');
$foo($baz);

Note that a docblock must be present, and must document every parameter type and the return type.

Check out the examples folder for more examples!

License

Recki-CT is released under the Apache-2 License.

Contributing

See CONTRIBUTING.md

And join the Google Group mailing list.

概覽

名稱與所有者google/recki-ct
主編程語言PHP
編程語言PHP (語言數: 2)
平台
許可證Apache License 2.0
發布數0
創建於2014-08-29 18:46:29
推送於2018-12-05 16:47:34
最后一次提交2014-12-22 11:20:23
星數550
關注者數49
派生數45
提交數77
已啟用問題?
問題數6
打開的問題數3
拉請求數7
打開的拉請求數1
關閉的拉請求數4
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?
去到頂部