4 ms·
Clojure is a functional programming language based on relational database theory. The Clojure system can be treated as a RMDB using the Lisp language, RMDB Sch
by lincpa 7y ago
Clojure is a functional programming language based on relational database theory.
The Clojure system can be treated as a RMDB using the Lisp language, RMDB Schema (Clojure Spec) is a static type, and SQL (LISP) is a dynamic type.
It is an example of the best combination of dynamic and static types.
It's innovation, simple, practical and reliable.
https://github.com/linpengcheng/PurefunctionPipelineDataflow/blob/master/doc/Clojure_is_FP_based_on_RMDB.md https://github.com/linpengcheng/PurefunctionPipelineDataflow...
- sandGorgon 7y agocould you elaborate on that ? how is it based on relational DB ?
- lincpa 7y agoClojure -> DBMS, Super Foxpro STM -> Transaction,MVCC Persistent Collections -> db, table, col hash-map -> indexed data Watch -> trigger, log Spec -> constraint Core API -> SQL, Built-in function function -> Stored Procedure Meta Data -> System Table In the latest spec2, spec is more like RMDB. see: https://github.com/clojure/spec-alpha2/wiki/Schema-and-select https://github.com/clojure/spec-alpha2/wiki/Schema-and-selec... The main development goal of clojure is to write the database. The development idea is actually from the database, not the FP. With reference to the database, as long as I use spec to strictly define (standardization) the core data model, I can ensure the correctness of the system. I've turned the traditional work of ensuring code correctness from in-code type system validation to data self-validation. Turn the work into verifying the core data model instead of validating the input and output data types of the function. Similar to industry, verify that all finished products meet the standards before entering the warehouse. Also similar to databases, verify their compliance before data enters the database. That is "Data as a service, Warehouse as the core, operates around it". A system requires only a few core data models, and development is built around the core data model. Persistent data structures ensure that the modification of the immutable big data model are high performance and memory efficient. In addition, using my pure function pipeline data stream (https://github.com/linpengcheng/PurefunctionPipelineDataflow https://github.com/linpengcheng/PurefunctionPipelineDataflow) makes debugging, parallelism and extension very simple. from: https://github.com/linpengcheng/PurefunctionPipelineDataflow/blob/master/doc/Clojure_is_FP_based_on_RMDB.md https://github.com/linpengcheng/PurefunctionPipelineDataflow...
- weavejester 7y agoThe main development goal of clojure is to write the database. The development idea is actually from the database, not the FP. This seems a tenuous theory. Clojure has been described as a language for data processing, but this isn't the same as basing the design on relational databases. Clojure isn't even relational; its data is generally kept in standard collection types, rather than relations. I'd describe Clojure as a dynamically typed, functional Lisp that emphisizes open data models and explicit time.
- lincpa 7y agoI think that mapping the data type of Clojure to the RMDB data model can achieve RMDB theory, simple operation, convenient viewing, high performance, and reliable results. I think the open data model is not an excellent and safe engineering practice. Map to static type RMDB schema, similar to RMDB with schema and data as the core, with sql operation, simple and reliable. Unrestricted open data model + dynamic type is not a good combination for constructing a complex large system.
- collyw 7y agoits data is generally kept in standard collection types, rather than relations. Isn't that the same as relational databases once you dig a layer deeper?
- cgrand-net 7y agoNo, it's hierarchical (because we nest collection types) vs relational.
- lincpa 7y agoIn RMDB(For example postgresql), Database is hierarchical nest collection types. It is also consistent with Clojure. ```clojure {:table01 {:row01 {:col-array [0 1 2] :col-json "{\"a\": \"Hello\"}" :col-text "abc"} :row02 {}} :table02 {:row01 {} :row02 {}}} ``` In addition, postgresql supports inheritance, which is also hierarchical nest collection types.