Sanctuary
marshal.ts
Our great sponsors
Sanctuary | marshal.ts | |
---|---|---|
5 | 29 | |
3,009 | 3,043 | |
0.1% | 2.5% | |
7.1 | 9.7 | |
2 months ago | 2 days ago | |
JavaScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Sanctuary
-
Ask HN: Freelancer? Seeking freelancer? (February 2024)
SEEKING WORK • Berlin, Germany • Remote or on-site • Software developer
I'm a software developer with 13 years of experience. I love leveraging software to save people time. I have a background in (visual) design and consider design to be crucial to the development of all software (even software with no visible interface).
I have deep knowledge of JavaScript. I have also worked professionally with TypeScript, Python, and Haskell. I enjoy working with HTML and CSS. I know React, and I'm looking for an opportunity to learn htmx.
I have created Sanctuary (https://sanctuary.js.org/) and several other libraries. :)
-
Ask HN: Who wants to be hired? (February 2024)
Location: Berlin, Germany
Remote: Yes
Willing to relocate: Possibly
Technologies: JavaScript, TypeScript, Python, Haskell, Clojure, Bash, SQL, HTML, CSS, React, htmx, functional programming
Résumé/CV: https://davidchambers.me/cv/
Email: [email protected]
Author of Sanctuary (https://sanctuary.js.org/) and several other libraries. I love writing parsers and interpreters. I enjoy writing shell scripts more than is healthy (ShellCheck is amazing). I love hyperlinks and discovering web standards.
-
Hegel – An advanced static type checker for JavaScript
I wonder if this will be something that functional libraries like Ramda [1] or Sanctuary [2] will be able to benefit from.
One of the reasons these libraries don't work so well with TS is that it doesn't have ML-style whole program inference and hence doesn't work so well with patterns like currying. Hegel seems more capable in that regard.
-
Introduction to Functional Programming in JavaScript
Fortunately, as it has been shown in this article, it’s definitely possible to use functional programming with plain JavaScript. However, if you really want to dive deeper into this paradigm while using JavaScript, you’ll probably want to use some already existing functional libraries such as Sanctuary, Fluture, Ramda and others.
-
Sanctuary Cheat Sheet
Hey everyone, I put together a [Cheat Sheet](https://github.com/identinet/sanctuary-cheat-sheet) for [Sanctuary](https://sanctuary.js.org/) that I hope is helpful to you.
marshal.ts
-
We use TypeScript not based on preference, but because we want to make money
zod or yup gets you quite a bit of the way there in practice - when you would reach for a Typescript type, making it in zod instead is more verbose but gives that runtime layer.
But for those who actually want full-stack non-stripped runtime type reflection based on Typescript syntax alone... https://deepkit.io/ - https://deepkit.io/blog/introducing-deepkit-framework - is a really promising and cool project.
It patches the typescript compiler (which pointedly considers runtime type information out of scope) with its own type compiler that emits a bespoke bytecode that is executed in a bespoke VM to communicate runtime type information to both server and client as needed. https://docs.deepkit.io/english/runtime-types.html
And from that baseline, there are very cool things you can do like an ORM entirely based on type annotations https://docs.deepkit.io/english/database.html or strongly-typed RPCs https://docs.deepkit.io/english/rpc.html .
It's very much in the alpha stage, but it's really well thought out - there's a tremendous degree of care the developer is taking towards code cleanliness and developer experience. I'm torn between wishing this project to have a fully funded team and take the world by storm, vs. "letting them cook" so to speak and seeing the developer experience unfold organically. Either way, it's a breath of fresh air into the Typescript ecosystem!
- Is there a TS backend development environment similar to what I have for the frontend?
-
TypeScript please give us types
Deepkit (listed in the article) is a fascinating project and really deserves to be more popular.
It also demonstrates that what is being asked for is actually practical.
-
Bebop introduces JSON-Over-Bebop for fast runtime type validation of raw JSON in Typescript; faster than Zod and other alternatives
Checkout deepkit One of the things it has is a really fast BSON parser, that is faster than the JSON one to my understanding. Interesting work with TS types too
-
Why nodejs engineers prefer express over nestjs? although nestjs forces good practice and proper architecture and it seems to be a right choice for complex and enterprise applications like asp.net and Spring. What are the limitations of nestjs compared to express?
Just for guys like you: Take a look at my restfuncs library or another nextgen RCP library then. So i tell you the code and time saving benefits straight upfront:
Take a look at restfuncs then. Or deepkit or telefunc.
-
Runtime TypeScript types change everything
Both work out of the box very well with Deepkit. You can either construct your own types in runtime or mix TS types with runtime information. See for example https://github.com/deepkit/deepkit-framework/blob/master/packages/framework/src/crud.ts where this is done
-
IS there a way to generate Swagger model schemas from interfaces
Yes, you can directly use the interfaces and types as is with Deepkit (https://deepkit.io) and the library deepkit-openapi. You get also full route documentation if you use the deepkit/http router where you can use interfaces and type aliases plus validation thpes for route parameters (query parameters, body, etc). It still in alpha, but approaches soon beta.
-
Hegel – An advanced static type checker for JavaScript
https://deepkit.io/ may be of interest to you! It deeply patches the TS type compiler to make all types visible at runtime, enabling a lot of annotation-style workflows and dependency injection possible completely within the type annotation system: https://docs.deepkit.io/english/runtime-types.html
Previous discussion: https://news.ycombinator.com/item?id=31663298 - it's downright mindblowing that all this seems to be the work of primarily a single developer.
For a less intrusive solution, https://github.com/jquense/yup is a great library to reach for whenever you're defining the shape of a network-transmitted object and don't want to introduce compilation stages.
-
Ezno
Marc J Schmidt has been working on this for typescript at https://deepkit.io/ and it looks very impressive, and ambitious. I made something similar for Flow a long time ago: https://gajus.github.io/flow-runtime/#/try
What are some alternatives?
ramda - :ram: Practical functional Javascript
RxJS
Index - ⚡ Pattern Matching in Typescript
Rambda - Faster and smaller alternative to Ramda
lodash - A modern JavaScript utility library delivering modularity, performance, & extras.
underscore-contrib - The brass buckles on Underscore's utility belt
immutable-js - Immutable persistent data collections for Javascript which increase efficiency and simplicity.
ts-jackson - A typescript library to deserialize and serialize json into classes. You can use different path pattern to resolve deeply nested structures. Every path pattern provided by lodash/get|set object is supported. Check out src/examples as a reference.
Quarkus - Quarkus: Supersonic Subatomic Java.
mimic-fn - Make a function mimic another one
Mout - Modular JavaScript Utilities
Kefir.js - You're looking for https://github.com/kefirjs/kefir