rapodaca / dialect.rs Goto Github PK
View Code? Open in Web Editor NEWReference implementation for the Dialect molecular language
License: MIT License
Reference implementation for the Dialect molecular language
License: MIT License
The Working with Graphs section of the MS points to a few problems and solutions for the interconversion of trees and graphs. It would be very useful for the RI to implement these solutions, thus saving the user the trouble of doing it themselves.
Items include:
Transformation may or may not be better placed in their own submodule.
It's dead code.
Only the following are supported: B; Br; C; Cl; N; O; P; S; F; I.
MS has reverted as well. This change brings the two into alignment.
There is no longer a need to support both. The set of elements in either case is: c; n o; p; s.
Boron-containing atoms can be selected.
There are only two: Atom
and Bond
. Both should implement Clone
.
Its only variant is range and it has nothing to do with trees.
Replace the return type of those features using Result with Option.
At a minimum, boundary cases should be tested.
It is no longer used.
For now at least, don't worry about changing the Follower
interface.
Removing this parameter would simplify the implementation of Follower
s. On the other hand, going this way could require additional work by clients who would need to mark the start of branches somehow.
Currently, it's usize
, which could by 64-bits. Only indexes of up to 32-bits in size are supported.
Revert to old format, which used a grid layout. Prevent further tampering with #[rustfmt::skip]
.
It is currently 0-99.
Everything after element 104 must go.
These are used in the MS.
This variant is no longer supported by the spec.
Start with child.rs
, which should become edge.rs
:
pub enum Edge {
Bond(Bond),
Split(Atom)
}
The rest should follow from this.
It is currently 0-999.
The current central abstraction is Atom
, a node in a molecular graph. The problem is that Dialect doesn't work directly with graphs, just trees. This is why strange artifacts like index pop up and can lead to invalid state. The current type are mismatched with the underlying problem that Dialect solves.
Atom
should remain the central abstraction, but from the perspective of a molecular tree. In other words, the main types should look like this:
pub struct Atom {
pub kind: AtomKind,
pub children: Vec<Child>
}
pub enum Child {
Union(BondKind, Terminal),
Split(Atom)
}
pub enum Terminal {
Atom(Atom),
Cut(Cut)
}
walk
performs a depth-first traversal over a root atom:
pub fn walk(root: &Atom, follower: &mut dyn Follower) -> Result<(), Error> {
todo!()
}
A Builder
implements Follower
to build a tree, returning its root:
pub struct Builder { }
impl Follower for Builder {
// todo
}
impl Builder {
pub fn build(self) -> Atom {
todo!()
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.