move idris version to orig and newt version to src.

Development is being done on the newt version now.
This commit is contained in:
2025-02-15 16:36:29 -08:00
parent 829c5d5143
commit 3c2615ecc1
52 changed files with 86 additions and 22 deletions

29
src/Serialize.newt Normal file
View File

@@ -0,0 +1,29 @@
module Serialize
import Prelude
import Node
import Lib.Common
import Lib.Types
import Data.SortedMap
-- this was an experiment, prepping for dumping module information
-- it ends up with out of memory dumping defs of some of the files.
-- Prelude is 114MB pretty-printed... gzip to 1M
pfunc dumpObject uses (MkIORes MkUnit): a. String a IO Unit := `(_,fn,a) => (w) => {
let fs = require('fs')
try {
let {EncFile} = require('./serializer')
let enc = EncFile.encode(a)
fs.writeFileSync(fn, enc)
} catch (e) {}
return Prelude_MkIORes(null, Prelude_MkUnit, w)
}`
-- for now, include src and use that to see if something changed
dumpModule : QName String ModContext M Unit
dumpModule qn src mod = do
let fn = "build/\{show qn}.newtmod"
let defs = listValues mod.modDefs
let ops = toList mod.ctxOps
let mctx = toList mod.modMetaCtx.metas
liftIO $ dumpObject fn (src,defs,ops,mctx)