Compile-step frontend frameworks and rescript
Will eliminating Vue SFCs allow seasmless integration? Vue components can be written like this: import { ref, h } from 'vue' export default { props: { /* ... */ }, setup(props) { const count = ref(1)...
View ArticleResi conflict when uncurried (v11)
I don’t know then. I actually also tried to use @@uncurried to gradually migrate our codebase to uncurried mode. But I failed because uncurried and curried code got mixed it and didn’t work well...
View Article$$prefix from build output
in this case, should gentype respect the prefixed name? the name of the generated type is original(non-prefixed), but the js isn’t. Yes, it should. That sounds like a bug
View Article"in-source" config bleeds into node_modules?
One useful trick is to register the JS modules as an exports entry in package.json. { "name": "my-package", "exports": { "./js-impl": "./src/path/to/impl.js" } } then you can use...
View ArticleWeird error with module type
I’m getting this error and I do not understand why, made this minimal repro: module M: { let f: (~a: option<int>=?) => unit } = { let f = (~a: option<int>=?) => { () } } which gives...
View ArticleReasoning about "inheritance"
so i’ve been away from rescript for a while, delving into a typescript project for work for some time. coming back, i’m having a hard time getting back into the proper mindset. right now, i’m...
View ArticleWeird error with module type
The sintax for optional arguments is different for signatures and actual implementation. You don’t specify the option part in the signature. module M: { let f: (~a: int=?) => unit } = { let f =...
View ArticleReasoning about "inheritance"
To start, an http server and a tcp server are two different things and probably have two different implementations, what are you trying to achieve my extending it?
View ArticleReasoning about "inheritance"
Incorrect inference about the “is-a” relationship is a pitfall of the class inheritance syntax. The HTTP protocol “consumes” TCP’s interface, not as part of it. In layered architecture, we call it...
View ArticleReasoning about "inheritance"
I mean this is an interesting discussion in and of itself, I guess you could theoretically build an UDP HTTP server. I still don’t think the “has-a” relationship is the correct way to go...
View ArticleReasoning about "inheritance"
it might actually be an incorrect understanding of the relationship between the two - it’s not like inheritance is not misused (by me and everyone else) in more object-oriented languages for the sake...
View ArticleRescript bindings for Graphql Codegen
Managed to get a initial plugin for @zth’s rescript-embed-lang up-and-running on a separate branch. Mostly seems to work, though it feels like I need to tweak the API a bit. Also need to ponder if...
View ArticleA few small questions
Why doesn’t type inference work in this scenario? module M = { type t = {foo: string} } let a = [] let b: array<M.t> = a->Array.map(x => {foo: x}) It says the record field foo can’t be...
View ArticleRescript bindings for Graphql Codegen
Nice job! Open a PR and ping me and I can give some feedback if you want.
View ArticleReasoning about "inheritance"
Then you can use mixins for simple cases. The only difference is that there is no implicit dispatch table and you manage it yourself. module Circle = { include Shape let method = () => { let _ =...
View ArticleA few small questions
Record fields are found based on being scope in the current module. If the field is defined in a nested module, then it is not in scope in the current module. You can follow the instructions in the...
View ArticleReasoning about "inheritance"
Thanks, I looked into that but it seems to be heavily discouraged. It works pretty well, except that you can’t e.g. add fields to types, so unless you want to manage any state whatsoever, you probably...
View ArticleGleams use expression
The Gleam hype started and I was curious about some language goodies. While reading the language tour (a lot of similar stuff to Rescript), I stopped at the use expression. Use what? The use...
View Article