Next, set your OpenAI API key as an environment variable:
export OPENAI_API_KEY="your-api-key-here"
Note: This command sets the key only for your current terminal session. To make it permanent, add the export line to your shell's configuration file (e.g., ~/.zshrc).
Can't any 3rd party utility running in the same shell session phone home with the API key? I'd ideally want only codex to be able to access this var
Yea that’s not gonna work, you have to export it for it to become part of your shell’s environment and be passed down to subprocesses.
You could however wrap the export variable and codex command in a script and just call that. This way the variable would only be part of that script’s environment.
That's neat! I only asked because I haven't seen API keys used in the context of profile environment variables in shell before - there might be other common cases I'm unaware of
I was going to ask about how pure types would fill the gap for other validations in Zod like number min/max ranges, but seeing the tags feature use intersection types for that is really neat. I tried assigning a `string & tags.MinLength<4>` to a `string & tags.MinLength<2>` and it's interesting that it threw an error saying they were incompatible.
That's because "minimum length" cannot be enforced in TypeScript. Maybe you already know this.
I'm not a Typia user myself, but my RPC framework has the same feature, and the MinLength issue you mentioned doesn't crop up if you only use the type tags at the client-server boundary, which is enough in my experience.
> At the time this article was written, the album consisted of 13,650 songs and had already surpassed the record held by Asha Bhosle, an Indian singer who recorded over 11,000 songs since 1947.
The latter is a prolific and renowned 91 year old Indian singer who has been singing for movies since the 40s in different genres and languages. This line in the article is good for putting the volume of the album in perspective, but I don't think generative music can be compared to her body of work.
I used this standard a long time ago to make a simple server -> client reactive state for a card game by combining it with Vue's reactive objects to get something like a poor man's CRDTs. This is a rough diagram of what it looked like: [1]. Although there was a reducer step on the server to hide private state for the other player, it's still probably wildly impractical for actual games.
> If we accept the fact that the web is inherently imperative, then I believe we can resolve most if not all of the above problems. We don't need to throw the baby out with the bathwater though, because JSX is fantastic.
Also look into SolidJS for dropping the "functional" component model while still retaining JSX - it looks similar to React but works more like Vue, running components as setup functions only on initial render and doing state updates with mutations via signals.
This is my first time reading about Gleam and it looks really cool! How's the experience of writing Vue components in it? Web frameworks like it and Svelte tend to liberally meddle with the syntax & semantics of JS through transpilation to have a specialized dev experience, so it can be difficult to use a different language and feel like a first class citizen since it's not like using a simple API anymore (unless there is special consideration given to it like ReScript and React).
Also, what's the concurrency story like? Gleam does not seem to support async/await but apparently it has colored functions when compiling to JS, though I'm not sure how those interop with the JS ecosystem.
vleam does not use Vue's `<script setup>`, but instead transpiles to a regular `<script>` block, so it does not rely on specialized syntax.
It works surprisingly well, and Gleam, being such a simple language, is a joy to code in. The main issues are honestly vleam itself -- the LSP is a bit finicky and the Vite plugin needs more work, as it sometimes requires a full restart and tends to transpile excessively. I expect most of this to be solved soon enough.
As for concurrency, the `fetch` usage example sums it up fairly well:
Learning about the auto-memoization feature when it was called React Forget made it seem like a pretty natural extension of the functional component paradigm - separating out and memo’ing parts within components based on info that’s trivially available at compile time (maybe not trivial, I’m not sure how much work is being done by the compiler here).
Is this something that could be implemented as a language-level feature for some “dedicated” language for writing functional reactive UIs? Languages like ReasonML are meant to map more nicely to React’s model because of their expressiveness, but I wonder if it could be taken further.
This looks like an important milestone for cross platform dev! I've seen a lot of people wishing Flutter supported Kotlin, so I wonder if it will become as prominent in mobile development. Does anyone know of significant downsides with the platform (apart from not being mature enough) that could prevent it from joining the ranks with Flutter and React Native?
This is not exclusive to web apps though (especially open source ones)? I don't see how what you said doesn't apply to the Adobe suite which is native.
export OPENAI_API_KEY="your-api-key-here"
Note: This command sets the key only for your current terminal session. To make it permanent, add the export line to your shell's configuration file (e.g., ~/.zshrc).
Can't any 3rd party utility running in the same shell session phone home with the API key? I'd ideally want only codex to be able to access this var