@@ -24,12 +24,6 @@ import System.IO
2424import System.Directory
2525
2626
27−idrNamespace :: String
28−idrNamespace = "__IDR__"
29−idrRTNamespace = "__IDRRT__"
30−idrLTNamespace = "__IDRLT__"
31−idrCTRNamespace = "__IDRCTR__"
32−
3327data CompileInfo = CompileInfo { compileInfoApplyCases :: [Int]
3428 , compileInfoEvalCases :: [Int]
3529 , compileInfoNeedsBigInt :: Bool
@@ -214,13 +208,13 @@ compileJS' indent (JSFunction args body) =
214208 ++ "\n}\n"
215209
216210compileJS' indent (JSType ty)
217− | JSIntTy <- ty = idrRTNamespace ++ "Int"
218− | JSStringTy <- ty = idrRTNamespace ++ "String"
219− | JSIntegerTy <- ty = idrRTNamespace ++ "Integer"
220− | JSFloatTy <- ty = idrRTNamespace ++ "Float"
221− | JSCharTy <- ty = idrRTNamespace ++ "Char"
222− | JSPtrTy <- ty = idrRTNamespace ++ "Ptr"
223− | JSForgotTy <- ty = idrRTNamespace ++ "Forgot"
211+ | JSIntTy <- ty = "i$Int"
212+ | JSStringTy <- ty = "i$String"
213+ | JSIntegerTy <- ty = "i$Integer"
214+ | JSFloatTy <- ty = "i$Float"
215+ | JSCharTy <- ty = "i$Char"
216+ | JSPtrTy <- ty = "i$Ptr"
217+ | JSForgotTy <- ty = "i$Forgot"
224218
225219compileJS' indent (JSSeq seq) =
226220 intercalate ";\n" (
@@ -284,10 +278,10 @@ compileJS' indent (JSString str) =
284278compileJS' indent (JSNum num)
285279 | JSInt i <- num = show i
286280 | JSFloat f <- num = show f
287− | JSInteger JSBigZero <- num = "__IDRRT__ZERO"
288− | JSInteger JSBigOne <- num = "__IDRRT__ONE"
281+ | JSInteger JSBigZero <- num = "i$ZERO"
282+ | JSInteger JSBigOne <- num = "i$ONE"
289283 | JSInteger (JSBigInt i) <- num = show i
290− | JSInteger (JSBigIntExpr e) <- num = "__IDRRT__bigInt(" ++ compileJS' indent e ++ ")"
284+ | JSInteger (JSBigIntExpr e) <- num = "i$bigInt(" ++ compileJS' indent e ++ ")"
291285
292286compileJS' indent (JSAssign lhs rhs) =
293287 compileJS' indent lhs ++ " = " ++ compileJS' indent rhs
@@ -361,7 +355,7 @@ compileJS' indent (JSWord word)
361355 | JSWord8 b <- word = "new Uint8Array([" ++ show b ++ "])"
362356 | JSWord16 b <- word = "new Uint16Array([" ++ show b ++ "])"
363357 | JSWord32 b <- word = "new Uint32Array([" ++ show b ++ "])"
364− | JSWord64 b <- word = idrRTNamespace ++ "bigInt(\"" ++ show b ++ "\")"
358+ | JSWord64 b <- word = "i$bigInt(\"" ++ show b ++ "\")"
365359
366360codegenJavaScript :: CodeGenerator
367361codegenJavaScript ci =