Status of my Julia implementation
Quote from tobega on January 27, 2021, 8:04 pmI have decided to take a pause in developing https://github.com/tobega/RelationalData because I'm not entirely sure where I want to go with it.
I've learned a lot about the type system and while it's not a static pre-compiled system, it can still give guidance and clear(-ish) error messages when types are required to be equal. I haven't yet explored the option to @generate functions, which is a way to do calculations on types in the compile stage rather than the run stage.
I implemented the adventofcode day 7 problem with the stuff I have so far, https://github.com/tobega/aoc2020/blob/main/a7ra.jl
I have two versions of each part of the problem, one using the more pedestrian project, rename, extend approach and another more flowing solution just doing a map operation from tuple to tuple.
The step-by-step would be easy to convert to SQL, I think, for a sane access layer to a database, while the map-version is what I would rather code in. As soon as we use a julia function it gets more difficult to express as SQL, but it seems entirely possible to decompile functions:
julia> f(t) = (x= t.a + t.b,)
f (generic function with 1 method)julia> code_typed(f, (Any,))
1-element Array{Any,1}:
CodeInfo(
1 ─ %1 = Base.getproperty(t, :a)::Any
│ %2 = Base.getproperty(t, :b)::Any
│ %3 = (%1 + %2)::Any
│ %4 = Core.tuple(%3)::Tuple{Any}
│ %5 = (NamedTuple{(:x,),T} where T<:Tuple)(%4)::NamedTuple{(:x,),_A} where _A<:Tuple
└── return %5
) => NamedTuple{(:x,),_A} where _A<:Tuple
I have decided to take a pause in developing https://github.com/tobega/RelationalData because I'm not entirely sure where I want to go with it.
I've learned a lot about the type system and while it's not a static pre-compiled system, it can still give guidance and clear(-ish) error messages when types are required to be equal. I haven't yet explored the option to @generate functions, which is a way to do calculations on types in the compile stage rather than the run stage.
I implemented the adventofcode day 7 problem with the stuff I have so far, https://github.com/tobega/aoc2020/blob/main/a7ra.jl
I have two versions of each part of the problem, one using the more pedestrian project, rename, extend approach and another more flowing solution just doing a map operation from tuple to tuple.
The step-by-step would be easy to convert to SQL, I think, for a sane access layer to a database, while the map-version is what I would rather code in. As soon as we use a julia function it gets more difficult to express as SQL, but it seems entirely possible to decompile functions:
julia> f(t) = (x= t.a + t.b,)
f (generic function with 1 method)
julia> code_typed(f, (Any,))
1-element Array{Any,1}:
CodeInfo(
1 ─ %1 = Base.getproperty(t, :a)::Any
│ %2 = Base.getproperty(t, :b)::Any
│ %3 = (%1 + %2)::Any
│ %4 = Core.tuple(%3)::Tuple{Any}
│ %5 = (NamedTuple{(:x,),T} where T<:Tuple)(%4)::NamedTuple{(:x,),_A} where _A<:Tuple
└── return %5
) => NamedTuple{(:x,),_A} where _A<:Tuple