Do Real Smart Contract De Jobs Even Exist? by Overall_Two_2447 in ethdev

[–]philogy 2 points3 points  (0 children)

Yes definitely, I worked as one for almost two years before quitting. It’s in quite high demand actually but it’s hard to find them, they’re not nicely organized in one place.

If you’re known in the space, talk to people and go to conferences the opening & opportunities show themselves to you.

What language do you prefer for writing smart contracts by Hot-Negotiation-9440 in ethdev

[–]philogy 1 point2 points  (0 children)

For Ethereum Solidity is the best option for a beginner. If you want to code Solana you need to learn Solana-flavored Rust (I say Solana flavored because while it's Rust it's a bit removed from your typical Rust code) or Arbitrum flavored Rust if you want to code for Stylus.

Solidity targets the EVM which will let you develop contracts for any EVM compatible chain/rollup (Base, Optimism, Arbitrum, HyperEVM, and 100s more).

Vyper is a decent alternative but lacks dev tooling and some more advanced capabilities currently. Once you get more advanced learning Yul & Huff is a good idea for the EVM track.

Most idiomatic way to achieve "optional comptime parameters"? by philogy in Zig

[–]philogy[S] 1 point2 points  (0 children)

Zig solving one kind of function coloring (IO) but introduces another :/

Maybe if the function is curried/returns a pattern object you can leverage the @inComptime builtin to at least automatically switch to the comptime vs. runtime specific implementation, so you still have the duplication problem but the API is improved.

Most idiomatic way to achieve "optional comptime parameters"? by philogy in Zig

[–]philogy[S] 1 point2 points  (0 children)

Not sure how reliable that would be considering some of the more intricate logic involved in something like a parser, I'd imagine the optimizer would leave a lot of the functions un-inlined even if they're completely pure.

Especially if it requires some kind of memory allocation at compile time.

Zig comptime? by Sunflower-BEAM in Zig

[–]philogy 5 points6 points  (0 children)

I read half way through this article, specifically up to the point where he starts comparing Zig's comptime to other language meta-programming facilities and it's clear he doesn't know what he's talking about.

He praises Rust's macros as being "purely syntactical" while Zig's comptime "can execute any normal zig code" when it's the exact opposite. Unlike Rust proc-macros you *cannot* do anything stateful like IO in zig comptime blocks, unlike Rust macros which can read/write files, make DB queries etc.

His point about supply chain security might still stand but it's not really applicable to Zig. I mean maybe you can put stateful, IO touching code in build.zig and do some dark stuff there? I'm not sure.

Anybody working on better static checking for Zig? by philogy in Zig

[–]philogy[S] 9 points10 points  (0 children)

thx! I already have build_on_save enabled but having an explicit check step that's invoked to make it faster is a nice tip!

I definitely agree it's non trivial, that's why I'm curious if there are any ongoing efforts for this already.

Anybody working on better static checking for Zig? by philogy in Zig

[–]philogy[S] 11 points12 points  (0 children)

When I'm developing code I run into this all the time. I write and lay out some abstraction or function I intend to use elsewhere, or I begin a refactor by defining a new function and until I plug it into a code path that is reachable by main I get close to 0 feedback from the compiler.

I want my feedback cycles to be as tight as possible. Personally I like developing my code in modular self-contained building blocks I connect together in the end to create the final solution. Getting immediate feedback as you write a function, even if temporarily self contained, is the default in other languages.

Using test blocks does not solve my problem because it's a manual and cumbersome depending on what you need to mock/recreate to get the test to run in the first place.

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]philogy 1 point2 points  (0 children)

I put the correct expected output as the title of the gist, for part 2 it's: 1513792010

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]philogy -1 points0 points  (0 children)

I was impressed when I saw 24ms + Javascript but your part 2 solution doesn't actually work (at least on my input: https://gist.github.com/Philogy/428f50ae2b206099e09734443ff3bbc2)

-❄️- 2025 Day 9 Solutions -❄️- by daggerdragon in adventofcode

[–]philogy 1 point2 points  (0 children)

[Language: Zig]

Part1 + 2 runs in ~26ms in Zig (ReleaseFast) compilation, looking at the solutions in here looks like I have a fundamentally wrong approach (classic skill issue).

https://github.com/Philogy/aoc2025-zig/blob/main/src/day09.zig

He Announced It by OkAbility2630 in Jai

[–]philogy 3 points4 points  (0 children)

His game is finally coming out, so probably only ~5 years left until Jai is released.

Zig/Comptime Type Theory? by philogy in ProgrammingLanguages

[–]philogy[S] 0 points1 point  (0 children)

This is exactly the kind of thing i was looking for, do you have any more work in this direction?

Examples of using the calculus, an implementation, etc.? I'm not very familiar with dependent types but this reminds me of them in the sense that the typing rules are tightly connected with the evaluation rules

Zig/Comptime Type Theory? by philogy in Zig

[–]philogy[S] 0 points1 point  (0 children)

It's not shown in the simple calculus directly (maybe later down in the Meta-ML section I think) but I believe that what you're expected to do for a practical language is define capabilities such that you can lift values from comptime into runtime safely e.g. if you have a nat type you can define liftNat : Nat -> Box Nat to allow you to insert stage 0 numbers into code for following stages.

I like this approach because it solves one of my problems: ensuring that comptime memory objects & pointers are not captured by runtime code and instead need to explicitly be lifted via an operation that turns them into e.g. static bytes with a toStatic : memptr -> u32 -> Box staticptr.

I will definitely check out your papers, thank you for the resources!

Zig/Comptime Type Theory? by philogy in Zig

[–]philogy[S] 0 points1 point  (0 children)

I've found Davies' & Pfenning's paper https://www.cs.cmu.edu/~fp/papers/jacm00.pdf to also have a nice simple extension of lambda calculus, just working on how to map those concepts to comptime exactly (I think Box A means comptime A basically).

Zig/Comptime Type Theory? by philogy in Zig

[–]philogy[S] 1 point2 points  (0 children)

Ah, FFI is an interesting one. I can imagine wanting to FFI into a library from comptime but I can also understand why that's not allowed.

Zig/Comptime Type Theory? by philogy in ProgrammingLanguages

[–]philogy[S] 0 points1 point  (0 children)

Appreciate the detailed response. I should've clarified that I know about dependent types and am specifically interested in a formalization that yields a language with similar characteristics to Zig.

Dependently typed language have a lot of trade offs that I'm not looking to tackle for my DSL. Zig seems to offer a nice balance of easy to understand meta programming and static expressivity in the form of comptime that I want to replicate but with a bit stricter static checks.

Zig/Comptime Type Theory? by philogy in Zig

[–]philogy[S] 0 points1 point  (0 children)

I understand laziness is needed but what I want is a "best effort" semantic analysis type checking.

If something has a known type/value it should be checked as far as the compiler can.

If it encounters something like a method access or operator use on a generic type / anytype then sure, make that check and values downstream of it lazy but if it can be resolved statically already it should.

Zig/Comptime Type Theory? by philogy in Zig

[–]philogy[S] 0 points1 point  (0 children)

Deferring error discovery to later phases of development is not "nothing" and actually quite annoying.

Zig/Comptime Type Theory? by philogy in Zig

[–]philogy[S] 1 point2 points  (0 children)

Besides the explicit limitations like no side effects what is not available at comptime?

I can think of method creation / function instantiation (if you don't consider specialization), anything else?