fragnix / fragnix Goto Github PK
View Code? Open in Web Editor NEWFragment-based code distribution!
License: BSD 3-Clause "New" or "Revised" License
Fragment-based code distribution!
License: BSD 3-Clause "New" or "Revised" License
We get slices like this, which is ugly
{-# LANGUAGE NoImplicitPrelude #-}
module F7007818387610957033 where
import F8137826209908809703 (deepseq)
import F2127085270274173167 (NFData)
infixr 0 $!!
f $!! x = x `deepseq` f x
($!!) :: (NFData a) => (a -> b) -> a -> b
There should be a repository online where many slices are hosted.
package-modules
does not work on packages with dependencies. It uses cabal install
with our custom haskell-modules
compiler. But this compiler does not implement a proper package database. Two possible directions to fix this are:
cabal install
(but we need it for dependency resolution)The modules in fragnix/primitive
for Integer
related functionality are from integer-simple
. We need them for integer-gmp
A lot of Haskell code is not actually written in Haskell but uses one or more of the extensions that GHC provides. We need to keep track of that on a per slices basis to be able to compile.
The runtime starts to become annoyingly long
Names and declaration files are next to each other in the same folder, but we want to have them in their own directory trees.
Type signatures are just declarations, but we need to find a way to associate them to the function body.
A type signature can specify the type of many symbols and therefore many functions at once. In this case we should split it.
haskell-names
comes with names for integer-simple
but not for integer-gmp
. We want to configure all packages (currently containers
and deepseq
) to use integer-simple
The resolver returns a set of slices. We want to know which of those contains the main
symbol to invoke the compiler on it.
We cannot extract the qualification of names from modules.
Somehow we are still missing symbols used by declarations in instances.
We only extract mentioned symbols from QName
s. The symbols in TypeSig
s are never qualified and therefore Name
s. A nice fix would be to convince the people at haskell-src-exts
to make these names QName
s.
We want to reliably find out what class and type an instance is for. Right now we only find out the class as all mentioned class symbols which clearly is a bug. We could have a special instance symbol.
Needed for #36.
We want a script to attempt to compile all slices and summarize the results
We do have an instance symbol for instance declarations but not for deriving declarations
Now that the pipeline from module files to compiled program works we need the infrastructure to test module files with more and more features.
Write a few more tests for the entire pipeline and the individual steps
The resolver currently assigns temporary IDs to slices. We need to compute a hash of each slice and replace all temporary IDs.
Mutually recursive declarations make problems in different phases:
Extraction: We need to detect cycles
Hashing: We cannot compute the hash without knowing it first
Compilation: We need hs-boot files for mutually recursive modules
Probably mutually recursive declarations have to be grouped into one slice.
The only declarations we extract from a module are function and pattern bindings
INLINE pragmas are not properly resolved by haskell-names
. Let's ignore them for now.
We put every instance into its own slice. The problem is that the instance depends on both the class it is of and the type it is for. When compiling we would have to import the instance in either one so that it is propagated. But this leads to cyclic imports. Maybe instances really need their own very special treatment.
There is a strange bug with infix declarations for \ and CPP. The workaround is
infixl 9 \\{-This comment teaches CPP correct behaviour -}
We need to find a good heuristic for when a declaration does or does not depend on a type class instance.
Sometimes we have Safe and/or Trustworthy pragmas that somehow prevent compilation. As an easy fix we could ignore them when assembling the comilation units.
We now have multiple folders under fragnix. Some of those are meant to be permanent and some are for temporary files. We should make this clear by creating a seperate temp
folder.
If we fail to find a symbol we should report an error. We should not abort because other declarations might work perfectly well.
The cabal solver wants to know that a version of base
is installed. Find a way to say so without a package database file
We group all type class instances with the class declaration but for builtin type classes there is not class declaration and so we need to group them with the data type the instance is for.
We want three tools:
package-declarations: given a package extracts all declarations from it
module-declarations: given a set of modules extracts all declarations from them
declarations-slices: given a set of declarations finds all slices
The NFData
class slice also has all instances for NFData
in it. Some of these mention the Bin
constructor from Data.Set
, some from Data.IntMap
and some from Data.Map
. But these were previously used unqualified with no problem. So they have no qualification.
We need an extra case for UsedName
where the name should be empty and we are using an instance.
In F5685558312108961428.hs
:
{-# LANGUAGE NoImplicitPrelude #-}
module F5685558312108961428 where
import GHC.Arr (!)
import F4889493513583856799 (vertices)
import F4140369130282544907 (Edge)
import F4001183171300763828 (Graph)
edges g = [(v, w) | v <- vertices g, w <- g ! v]
edges :: Graph -> [Edge]
The import of !
should be import GHC.Arr ((!))
We want to be able to convert a set of modules.
The names of the symbol files in fragnix/builtin are hierarchical and not flat as opposed to the ones in fragnix/names. Write a one time script to flatten them.
We want a web app to explore a folder full of slices. Viewing them in an editor is tedious.
package-declarations
takes the name of a package and produces fragnix/names
and fragnix/declarations
. There should be two different steps instead: package-modules
takes a package and yields perfect, preprocessed, parseable Haskell module files. Then module-declarations takes these modules, does name resolution and extracts the declarations.
The best would be to fork haskell-names and change the symbol type
fixities currently end up in their own compilation unit which is wrong
The difference between variables like x
and symbols like ++
is lost during name resolution.
We currently use the global names database that comes with haskell-names
. Going further we will want our own database in fragnix/names
for easy distribution and better control.
We want to store some Map Symbol SliceId
called an environment to make nests mergeable.
The path of the file fragnix is invoked on is currently hard-coded. We want to take it on the command line. Eventually we want to take an entire folder (after #5 is resolved). We also want some output to indicate progress and nice error messages.
We need a list of all symbols that are considered builtin for name resolution and for classifying references during slice generation. We currently have builtin modules in fragnix/builtin
. Related to #20.
Part of #4 is to properly extract used names in instance constraints. Fails to compile:
{-# LANGUAGE NoImplicitPrelude #-}
module F1979410200377991118 where
import GHC.Arr (bounds)
import GHC.Arr (elems)
import GHC.Arr (Array)
import F5363716782726002741 (NFData)
import F5363716782726002741 (rnf)
instance (Ix a, NFData a, NFData b) => NFData (Array a b) where
rnf x = rnf (bounds x, Data.Array.elems x)
We need to track dependencies on foreign source and header files. Probably there should be foreign slices.
We need to ensure that all instances of a type class end up in its compilation unit or that all instances for a data type end up in its compilation unit. Part of fixing #4
Pretty printing is not pretty enough in my opinion. We should check if a fragment parses and then use the original source.
The following does not compile:
{-# LANGUAGE NoImplicitPrelude #-}
module F5030602782144409221 where
import GHC.Prim (seq)
import Data.Complex (Complex(:+))
import Data.Complex (Complex)
import F5363716782726002741 (NFData)
import F5363716782726002741 (rnf)
instance (RealFloat a, NFData a) => NFData (Complex a) where
rnf (x :+ y) = rnf x `seq` rnf y `seq` ()
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.