Commit Graph

13 Commits

Author SHA1 Message Date
Michael Oliver
76cc14d637
Add an example project (#412)
* Add an example project

* Fix credo/ebert issues

* Re-run formatter

* add vector products to example, capitalize Thrift, change divide matching
2018-08-28 17:12:45 -07:00
Jon Parise
417fed1941
Ignore the .elixir_ls directory (#387)
This is used by the Elixir Language Server and shouldn't be stored in
source control.
2018-08-16 11:34:19 -07:00
Jon Parise
ceb4de2560
Revise Travis CI configuration (#376)
- Treat compilation warnings as errors
- Report coveralls for all build environments
- Conditionally run `mix format` from inside `.travis.yml`
- Cache the `deps/` directory instead of mix archives
- Only include credo in the :dev environment
- Only include excoveralls in the :test environment
2018-08-06 09:25:48 -07:00
Jon Parise
2132b89a72 Support additional include paths (#219)
We previously only supported including other Thrift files whose
pathnames were relative to the current file. This change allows a list
of additional include (search) paths to be specified as part of the
project configuration (`thrift.include_paths`) or via a command line
option (`--include dir`).
2017-02-08 15:00:13 -08:00
Preston Guillory
cc81ac3620 Ignore tmp directory (#160)
The tmp directory is used to store temporary .thrift and generated files by
ThriftTestCase. It's typically around during development and contains files but
they should not be checked in.
2017-01-06 04:34:51 -08:00
Jon Parise
604f5b5b33 The Thrift compiler task now uses Thrift.Generator (#124)
Our :thrift compiler is now implemented in terms of our Elixir code
generation framework. This drops our dependency on the Apache Thrift
compiler binary.

The new Thrift.Generator.targets/1 function is used to determine the
full set of generated output files for a given input .thrift file. This
ensures that we only generate Elixir source code for stale outputs.

It can now do everything that `thrift.generate` could do, so we can
retire the latter.
2016-12-31 17:02:47 -08:00
Preston Guillory
819216f830 Pure elixir implementation (#54)
A pure Elixir implementation of the Thrift binary protocol.

This PR includes serialization and deserialization for all thrift types as well as testing to make sure we match the thrift spec (which can be found here: https://erikvanoosten.github.io/thrift-missing-specification/#_binary_encoding)

The binary protocol is generated alongside the thrift data types, yielding a much faster implementation than the apache project's canonical one. 

Our benchmarks (using benchfella) indicate a speedup of between 10 and 20x.

## Binary Protocol Performance
benchmark name |  iterations | average time 
------------------|-----------|---------------
elixir serialization (left as IOList)                   |  2000  | 849.01 µs/op
elixir serialization (iolist_size)                        |  2000  | 933.83 µs/op
elixir serialization (converted to binary)        | 1000   | 1281.23 µs/op
elixir deserialization                                       |  1000   | 1178.46 µs/op
erlang serialization left as IOList                    |   100   | 10284.84 µs/op
erlang serialization (converted to binary)      |   100   | 11588.89 µs/op
erlang deserialization                                      |   100   | 21433.17 µs/op
2016-11-30 11:31:59 -08:00
Steve Cohen
bb1c1a4dce An implementation of the Thrift parser
This PR introduces a parser based on @jparise's lexer. The parser
runs on thrift files and produces a set of Program models. The
intention is to be able to give Elixir full-fledged thrift support
and a better implementation.
2016-06-14 08:53:54 -07:00
Jon Parise
99ee1f4862 Add a test suite for Mix.Tasks.Compile.Thrift
These tests rely on a working thrift compiler being available in the current
test environment, but that's a reasonable requirement because it's also a
prerequisite for using this mix task in the first place.
2016-05-25 11:54:01 -07:00
Jon Parise
6284a12fc9 Add documentation support via ex_doc. 2016-02-02 10:34:09 -08:00
Jon Parise
4b28b5a979 Provide a leex-based Thrift IDL lexer.
This represents just the lexer definition. Full grammar parsing (i.e. yecc)
support will come later.

The lexer definition is largely complete, but there may be some issues with
string literals containing escaped characters \t and \n.
2016-01-18 19:32:02 -08:00
ed t
0122ebe51a Various build process enhancement
* add travisci support
* run code coverage post result to coverall.io
* add project info for hex package
* add Build and code coverage badge, compile only
2016-01-04 20:33:19 -08:00
Jon Parise
cf5442f7b0 Initial revision. 2015-01-06 17:51:59 -08:00