Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO list #261

Open
serkonda7 opened this issue Dec 10, 2024 · 0 comments
Open

TODO list #261

serkonda7 opened this issue Dec 10, 2024 · 0 comments

Comments

@serkonda7
Copy link
Member

serkonda7 commented Dec 10, 2024

This list is regularly updated expanded but please note that the order of items may change at any time.

All PRs or further suggestions are welcome!

-----------------------------------------------------------
HIGH

err if struct init of private field

fix branch does not return a value due to last line return
  fun (mut p Parser) pub_stmt() !ast.Stmt {
      return match p.peek() {
          .key_const{ p.const_decl()! }
          .key_enum{ p.enum_decl()! }
          .key_fun{ p.fun_decl()! }
          .key_interface{ p.interface_decl()! }
          .key_static { p.static_decl()! }
          .key_struct{ p.struct_decl()! }
          else{ return error('cannot use pub keyword before ${p.peek()}') }
      }
  }

check-md: use baitexe

-----------------------------------------------------------
MEDIUM

cli package

-----------------------------------------------------------
LOW

formalize commit msg guidelines

formalize suggested development flow
  bait > b.js > ...
  bugfix PR: 1. commit test (fail), 2. commit fix (OK)

refactor compiler cli, prefs, builder and related

-----------------------------------------------------------
NONE

allow compiling test files
  but give a info about test command
  related:
    bait build: if file has _test, give meaningful error
      currently: "error: main package has no main function"


===========================================================
OLD
===========================================================


term.color: proper detection of color support

builder: refactor error handling

bait.errors color handling refactor

-----------------------------------------------------------

FunDecl, CallExpr
  rework .key()
  always prefix fun with pkg
  redesign method registration

StructDecl
  remove pkg_prefix
  always prefix with pkg

TypeDecl
  check if name is pure

scope object sumtype
  fix field access

number promotion

checker: rework type checks (comparison)
  add something like is_equivalent

as cast: check if casting is even possible/safe

mutability checks
  call with mut arg: IndexExpr
  mut method call on selector
enforce immutability
  array el assign
  map el assign

no noise on return of type that was not found (e.g. structField) and assign to it

exp ret val of string
  return "" + _err

improve error messages
  show err line and context (one before, one after)
  highlight error cols by ^^^

testing: consider forward slash paths in err msgs on windows too
depgraph

ci:
  use scripts like V
  c test runner that skips unsupported
  add problem matcher
scope/ast: ast should contain is_pub info as well
  e.g. required for formatter
FunDecl: check return type exists
sumtype variant check
  fix x is i32
  check type exists: x is Type
sumtype match: check variant is patrt of sumtype
sumtype typeof match
sumtype field access: allow if field is present on all variants
strconv
semver pkg
check and enfore naming schemes
  enforce lowercase package names a-z0-9_
rethink handling of ast.Ident for
  as casting
  is type checks
  match type
js: os.rmdir_all fix crash if dir not exists
  cleanup init_test before run
fix pointers
  js: always a ref
  c: general pointer handling
  update docs
  add example
@no_builtin
  use in builtin and decls
refactor c declaration handling
  special lib package
  imported by builtin and others
raw strings
  refactor and test util.escape
optional type (?foo)
  keyword none (alternatives: nil/null)
  only allowed in struct fields
  use in cli for exec
consider " for strings and ' for chars
tools/ast: rework
  allow printing tokens, parser ast and transformer ast
c: inout test
formatter/vet tool
  at least catch warnings in code for other backends/OSes
  problem arose in field modifier syntax change (gh-233, ...)
use FFI scope for more stuff
universe scope for tracking primitive types
fix comment after void return
array index panic
  array.slice
    low > high
    high > length
    NOTE: low > length not needed
  array.get
struct field mutability: different error if mut or global needed
redef: merge is_redef and get_signature into one function
  propably requires option types
builtin: uppercase String struct
struct update syntax
  ...node
check-md
  perf improvements
  win: fix return 0 on fail
output tests: improve performance
redef: show place of declaration for other redefs too (in block scope)

consider rust-like type suffixes for numbers

c: map implementation
progress c backend
improve, fix, refactor
  selector expr
  generics
  result type
  sum types
  references
  mutability
fix generic structs
fix generic methods

-----------------------------------------------------------
0.0.x

fix & MAX_U32 workaround for bitwise not on u32
fix methods on number literals
struct embedding
share more code between gen backends
cleanup and refactor ast package
  especially
    types
    table
gen.c: use temp var for pointer to fun call "ext_files.push_many(walk_ext(fpath, ext))"
package manager
give "as" higher precedence
implement --arch flag (x64, x32, arm, node, web)
consider rename of -cc to -c/--compiler
os: remove one of user_os() and platform()
replace os.platform() with $if WINDOWS or LINUX
JS interop fixes and improvements
dedicated JS node/web backends
formalize import lookup
  lib|.bait/pkgs|...
  add flag to overwrite path (e.g. --imports)
website bait-lang.org
better docs
help: ? consider moving help texts of folder tools inside their folders

-----------------------------------------------------------
0.0.x

struct field smartcast
JS: use pub fun ... to export the symbol and @export only for the name
  only should apply to the compiled toplevel package
TODO how to diff generic struct init from array indexing
  vars always snake_case
    enforce?
  consts always BIG_ONLY
    enforce?
improve generated JS efficieny and perf
cgen: fix clang warnings
decide if ForIn and ForClassic ast nodes should be merged
mut loop must be on mut ident
  a := [1,2,3]
	for mut n in a {
	}
anon sum types
make: compile symlink not as root
interpolation: number formatting
simplify checker
  infix
  fun, call
  selector
prevent infix math +-/* in bad cases
  non numbers
  not overloaded
fix import relative sub package
  parser.pkg_decl needs to adopt logic like builder
interop: change const to "const #X.name type" (remove ":=")
js pass by ref if needed
  gen has to wrap val in object on the fly
  affects decl, and any other operations especially methods
self: respect --timings
generic methods
  fix [1,2].index('s')
str: fix indent of array of structs
add $DIR comptime var to replace os.dir($FILE)
prevent or fix
  struct Foo{}
  type Bar := Foo
  x := Bar{}
treat src dir like wd and use parent folder as outname
bait: struct implementing interface
error handling: catching panics
c: arr to string
test for strings package
varargs
map with enum keys
unify type representations in JS
  e.g. new i8 ... new bool
    toString method
    toJs method
  new MyType
    gen
      write default value
      as cast
#82: array init "init" field
improve JS interop
  resolve TODOs in os package
  declare builtin functions like console
fix #14
if guard
  if x := whatever() {
    println(x)
  }
non-js interfaces
error on undefined operation of structs
operator overload
  auto gen of comparisons from == <
  auto gen math assigns from + - * / %
warn on dead code
  code after a return
  loop/if with condition that's always false
disallow adding custom methods to builtin types
rename length to len

-----------------------------------------------------------
0.x

parity checks
  os (linux/win)
  backends (js/c)
pub: warn if used in main package
vet tool: analyze code for suboptimal things
  complexity: too many levels of indent
doc comments
docs gen for packages
skip unused functions, structs, ...
attrs: strict applies to what
  fun
  method

-----------------------------------------------------------
1.x

checker: apply type exists to more
  ? are there any other places where this should be done
unify is_pub checks
  info about is_pub and pkg is contained in ast nodes, Scope, TypeSyms
  this should be merged and unified
get rid of array method workarounds
c backend (mac, ...)
jsgen
  match: omit break after continue / return
varargs

@serkonda7 serkonda7 pinned this issue Dec 10, 2024
@serkonda7 serkonda7 changed the title My TODO list TODO list Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant