Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
125 lines (103 loc) · 3.85 KB

File metadata and controls

125 lines (103 loc) · 3.85 KB
Copy raw file
Download raw file
Outline
Edit and raw actions

Fklang

Build Crates.io codecov

origin idea from Forming, but it's too complex. So I decide to rewrite it with TypeFlow

Fklang,一个基于软件开发工业化思想设计的架构 DSL。 通过显式化的软件架构设计,以确保软件系统描述与实现的一致性,并探索结合 AI 代码生成。

Try it: Feakin Quick Start

Spec: Feakin Specification

Install

cargo install fkl_cli

Modules

  • Parser
    • fkl_mir. the intermediate representation of fklang
    • fkl_parser. parser for fkl.
    • fkl_parser_wasm. wasm wrapper version of fkl_parser.
  • CLI. CLI for generator code and IDE support.
    • fkl_cli. the cli for fkl, like code_gen, dot_gen or others.
    • time travel debug trace for implementation flow steps.
  • LSP. language server protocol, for IDE/Editor Support
    • fkl_lsp. language server for fkl.
    • editors/vscode. VSCode extension that launches fkl_lsp over stdio.
  • CodeGen. code generator for fkl.
    • fkl_codegen_dot. generate Graphviz dot language from fkl source.
    • fkl_codegen_java. generate Java code from fkl source.
    • fkl_codegen_sql. generate SQL schema from fkl source.
  • Plugin System
    • fkl_ext_loader. load external plugins for fkl.
    • fkl_ext_api. the api for external plugins.
    • plugins
      • ext_kafka. the plugin for kafka.
      • ext_computing. the plugin for computing.
      • ext_codegen_aws. the plugin for aws codegen.
    • ext_sourceset_swagger. the plugin for swagger.

Time Travel Debug

Print a replayable flow trace with source locations, symbolic state snapshots, and state diffs:

fkl debug --main docs/samples/impl.fkl --format text

Example output:

# Time Travel Debug Trace
0 UserCreated POST /user/{id} UserRepository.getUserById
  source: docs/samples/impl.fkl:82:5
  writes: user:User
  state before: []
  created: user:User=UserRepository.getUserById#0
  state after: [user:User=UserRepository.getUserById#0]

Use --format json to feed the same trace into IDE, DAP, or other tooling.

Start the Debug Adapter Protocol server over stdio:

fkl dap --main docs/samples/impl.fkl

The adapter supports initialize, launch, threads, stackTrace, scopes, variables, next, continue, disconnect, plus timeTravelTrace and timeTravelSeek for replay tooling.

Roadmap

  • DSL Design
  • IDEA Plugin
  • Code gen
    • with Spring
      • Controller
      • DDD
  • contract base testing
    • mock server
    • with HTTP API
  • database integration: JPA, JDBC, etc.
    • database integration
      • MySQL
      • PostgresSQL
    • database schema generation
    • database migration
  • plugin system
    • plugin api
    • plugin registry
  • simple expr
    • Expr
      • logic expr
      • math expr
      • etc.
    • Filter
    • REPL
    • ExprTk with Rust?
  • module support
    • module dependency
    • module versioning
  • bootstrapping DDD DSL
    • use type system to describe domain model
  • build system inside: cache, incremental build, etc.
    • better code generation
  • general programming language (if possible)
    • function support
    • expression support
  • IDE support
    • VSCode LSP extension
    • VSCode Time Travel Debug adapter
  • debugging
    • Time Travel Debug trace for FKL flows

License

@2022 This code is distributed under the MPL license. See LICENSE in this directory.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.