Trending

#StaticTyping

Latest posts tagged with #StaticTyping on Bluesky

Latest Top
Trending

Posts tagged #StaticTyping

Static typing in Ruby remains contentious. While RBS is a step, some feel it dilutes Ruby's simplicity. Alternatives like Sorbet & `low_type` are explored, highlighting the community's struggle to balance flexibility with robust type checking. #StaticTyping 3/6

0 0 1 0
Post image

Python's static analysis gets a boost with mypy-pure and mypy-raise, adding purity checks and exception handling to type hints. Developers can catch side effects and runtime errors earlier. #Python #StaticTyping

0 0 1 0

Not all static type systems are equal. Rust's ownership model and traits offer superior safety and expressiveness compared to languages like Java or C++, providing deeper guarantees against common pitfalls. #StaticTyping 4/5

0 0 1 0
type Signal<T extends object> = T & {
    onChange: (callback: Callback<T>) => () => void;
} & {
    [K in keyof T as `on${Capitalize<string & K>}Change`]: (callback: (value: T[K], oldValue: T[K]) => void) => () => void;
} & {
  [K in keyof T as `${string & K}AsSignal`]: T[K] extends object ? Signal<T[K]> : Signal<{value: T[K]}>;
}

type Signal<T extends object> = T & { onChange: (callback: Callback<T>) => () => void; } & { [K in keyof T as `on${Capitalize<string & K>}Change`]: (callback: (value: T[K], oldValue: T[K]) => void) => () => void; } & { [K in keyof T as `${string & K}AsSignal`]: T[K] extends object ? Signal<T[K]> : Signal<{value: T[K]}>; }

Mapped types: transform generic object keys into new types using key mapping and template literals. Recursively create new signatures per object key. Enables scalable, type-safe contracts at the type level. (see image)

#TypeScript #StaticTyping #MappedTypes

1 0 0 0

A major driver for Teal is the need for better maintainability and refactoring in larger Lua projects, especially in game development. Static types are seen as crucial for managing complexity beyond a certain scale. #StaticTyping 2/6

1 0 1 0

Conversely, many believe gradual typing can improve safety & scalability in Ruby without forcing a full static paradigm shift or sacrificing the language's beloved productivity. #StaticTyping 6/6

0 0 0 0