feat[bytecode]: A lot of scaffolding for setup

This commit is contained in:
vegowotenks 2025-08-14 13:22:31 +02:00
parent 766528677f
commit f9ea61d348
7 changed files with 130 additions and 0 deletions

View file

@ -0,0 +1,21 @@
{-# LANGUAGE Trustworthy #-} -- Trustworthy because it imports Vector but does not do unsafe things
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-- | This module describes a Bytecode Object, similar to a java classfile. It will hold source information, shared constants and
module Language.Scalie.Bytecode.Object (Object(..)) where
import Data.Kind (Type)
import Data.Vector (Vector)
import Language.Scalie.Ast.Provenance (Provenance)
import Language.Scalie.Bytecode.Instruction (Instruction)
import Language.Scalie.Ast.Provenance.SourceLocation (SourceLocation)
import Text.Show (Show)
import Text.Read (Read)
import Data.Semigroup (Semigroup)
import Data.Monoid (Monoid)
type Object :: Type
type role Object
newtype Object = Object { instructions :: Vector (Provenance SourceLocation Instruction) }
deriving stock (Show, Read)
deriving newtype (Semigroup, Monoid)