TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: OCaml scripting framework that scales to full-featured apps

1 点作者 beckford大约 1 年前
I wanted a way to distribute small pieces of functionality (ie. scripts) to users. Functionality like: - Downloading and configuring JDKs, Gradle and Android Studio so that users could use my software development kit. - Launching a complex cross-compile in WSL2. - Metaprogramming code-translation tools: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38748249">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38748249</a><p>&#x2F;Distribution problem&#x2F; I needed these scripts to be usable by junior engineers (devs who have had only one programming language course in high school) and work on the major desktops (Windows, macOS and marginally Linux). My initial solution was to distribute a set of POSIX scripts (MSYS2 on Windows). That was highly error-prone even with a good linter, and it was hard to troubleshoot problems (stack traces are really useful!). My second solution was to distribute CMake scripts and that worked for quite a while. The problem was the CMake scripts didn&#x27;t scale well ... if one CMake script included another CMake script but a function&#x27;s parameters changed, I&#x27;d get no signal until runtime that the software was broken.<p>&#x2F;Hackable problem&#x2F; And over time, I realized I had a new requirement: my users should be able to edit and adapt the scripts to their own needs.<p>So, I created and have been using the &quot;DkCoder&quot; scripting framework for the past two months. It is an early alpha based on OCaml, and I haven&#x27;t finished porting my CMake based scripts yet. But I surprised myself: I thoroughly enjoyed using DkCoder for scripts that I had no intention of distributing to users. This was a new use case I hadn&#x27;t anticipated. In a week I was able to create a real production service (a webhook) that interacts with AWS SES, Stripe, GitLab and 1Password to manage subscriptions for my software kit. And much of that week was low-level REST plumbing because I wanted to simulate scripting for SaaS teams that didn&#x27;t yet have their client libraries ready. That is one of three examples included with DkCoder.<p>I&#x27;d like feedback whether or not this scripting framework is something you could see yourself using.

暂无评论

暂无评论