From 977f4f66f0a25f07092ddf2164687b9bbd180b4d Mon Sep 17 00:00:00 2001 From: Nikita Tchayka Date: Sat, 16 Sep 2023 18:03:42 +0100 Subject: Update features --- .../HomepageFeatures/coming-soon-features.tsx | 84 +++++++++++++++------- src/components/HomepageFeatures/index.tsx | 25 ++++++- src/components/HomepageFeatures/ready-features.tsx | 77 ++++++++++++++------ 3 files changed, 136 insertions(+), 50 deletions(-) diff --git a/src/components/HomepageFeatures/coming-soon-features.tsx b/src/components/HomepageFeatures/coming-soon-features.tsx index e2ff10a..c487e2c 100644 --- a/src/components/HomepageFeatures/coming-soon-features.tsx +++ b/src/components/HomepageFeatures/coming-soon-features.tsx @@ -3,7 +3,7 @@ import { FeatureItem } from "./feature-item"; export const ComingSoonFeatures: FeatureItem[] = [ { - title: "Beautiful, Ready-to-Use Tools", + title: "A beautiful standard library", description: ( <> NeoHaskell offers a clean and intuitive language design, complemented by @@ -14,50 +14,84 @@ export const ComingSoonFeatures: FeatureItem[] = [ buttonText: "Start Coding", showcase: { language: "haskell", - code: `processLogs rawLogs = - rawLogs - |> map parseLogs - |> collect - |> andThen (filter isImportant) - |> andThen (map toStructuredLog)`, + code: `"NeoHaskell is cool" + |> Text.toWordList + |> List.map Text.length + |> List.map (\\x -> x * x) + |> List.takeIf Int.isEven`, }, }, { - title: "Hassle-Free Development Environment", + title: "An integrated build system", description: ( <> NeoHaskell's CLI tool installs all required utilities and makes - multi-platform support a breeze. Whether you're compiling to native code - or generating WebAssembly for browser compatibility, you'll enjoy error - messages that guide, not hinder. + multi-platform support a breeze. Whether you're compiling to native + code, installing dependencies, or packaging your application for + deployment, you'll enjoy a seamless experience. ), buttonText: "Enjoy the Ride", - showcase: { code: "", language: "" }, + showcase: { + language: "bash", + code: `$ neo setup +Setting up NeoHaskell... +Downloading the latest version of the compiler... +Installing build process plugins... +Done! + +$ neo build +Building... + +$ neo add scotty +Adding 'scotty' to your project... +Installing dependencies... +Done! + `, + }, }, { - title: "Focus-Driven, Event-Driven", + title: "Mobile development", description: ( <> - In NeoHaskell, you work directly events and functions that react to - them. Say goodbye to the cognitive overhead of managing state or - wrestling with dependency injection. Your focus stays where it belongs: - on solving problems and crafting solutions. + Build mobile applications with NeoHaskell. The CLI tool lets you + generate a client package with auto-update support, and the generation + of UIs is a breeze with the included UI library. ), - buttonText: "Begin your Journey", - showcase: { code: "", language: "" }, + buttonText: "Conquer Mobile apps", + showcase: { + language: "haskell", + code: `screen = do + body [] do + image [source "/img.png"] + text [] "Hello World!"`, + }, }, { - title: "Naturally Full-Stack", + title: "Python interop", description: ( <> - Relish the ease of crafting full-stack applications in a unified - language environment. NeoHaskell takes care of frontend-backend - communication, allowing you to focus solely on your application's logic. +

+ With the rise of the AI era, it is now more important than ever to be + able to leverage the power of Python's AI ecosystem. NeoHaskell, with + its Python interoperability, lets you do just that. +

+
+

+ Use LangChain, Stable Diffusion, PyTorch, and other Python libraries + right from your NeoHaskell code. +

), - buttonText: "Experience Bliss", - showcase: { code: "", language: "" }, + buttonText: "Engage Galaxy Brain", + showcase: { + language: "python", + code: `answer question = [python| + from langchain.llms import OpenAI + llm = OpenAI() + return llm.predict("hi!") + |]`, + }, }, ]; diff --git a/src/components/HomepageFeatures/index.tsx b/src/components/HomepageFeatures/index.tsx index 337d39a..ce03948 100644 --- a/src/components/HomepageFeatures/index.tsx +++ b/src/components/HomepageFeatures/index.tsx @@ -9,9 +9,28 @@ import { FeatureItem } from "./feature-item"; import { ReadyFeatures } from "./ready-features"; import { ComingSoonFeatures } from "./coming-soon-features"; +const bgAndShadows = [ + { + bg: "bg-violet-200", + shadow: "shadow-neocyan", + button: "yellow", + }, + { + bg: "bg-yellow-200", + shadow: "shadow-neoviolet", + button: "cyan", + }, + { + bg: "bg-green-200", + shadow: "shadow-neoyellow", + button: "violet", + }, +]; + function Feature({ n, title, showcase, description, buttonText }: FeatureItem) { const k = n ?? 0; const reverse = k % 2 === 0 ? "xl:flex-row" : "xl:flex-row-reverse"; + const { bg, shadow, button } = bgAndShadows[k % bgAndShadows.length]; const showcaseComponent = "code" in showcase ? ( // {showcase.code} @@ -28,7 +47,7 @@ function Feature({ n, title, showcase, description, buttonText }: FeatureItem) { //
return (
{showcaseComponent} @@ -37,7 +56,7 @@ function Feature({ n, title, showcase, description, buttonText }: FeatureItem) {

{title}

{description}

-
@@ -50,7 +69,7 @@ export default function HomepageFeatures(): JSX.Element { return (
- +
{/* horrible hack to hide the vertical bar */} diff --git a/src/components/HomepageFeatures/ready-features.tsx b/src/components/HomepageFeatures/ready-features.tsx index d76adc9..5ccb6bf 100644 --- a/src/components/HomepageFeatures/ready-features.tsx +++ b/src/components/HomepageFeatures/ready-features.tsx @@ -3,7 +3,7 @@ import { FeatureItem } from "./feature-item"; export const ReadyFeatures: FeatureItem[] = [ { - title: "Static feels like Dynamic", + title: "A Static that feels like Dynamic", description: ( <> NeoHaskell's type system is so powerful that you'll forget it's there. @@ -14,7 +14,7 @@ export const ReadyFeatures: FeatureItem[] = [ buttonText: "Start Coding", showcase: { language: "haskell", - code: `process = do + code: `verify = do joe <- getPerson "Joe" if joe.age > 18 then print "Joe is an adult" @@ -23,41 +23,74 @@ export const ReadyFeatures: FeatureItem[] = [ }, }, { - title: "Hassle-Free Development Environment", + title: "Lazy Evaluation for Eager Minds", description: ( <> - NeoHaskell's CLI tool installs all required utilities and makes - multi-platform support a breeze. Whether you're compiling to native code - or generating WebAssembly for browser compatibility, you'll enjoy error - messages that guide, not hinder. + NeoHaskell won't evaluate an expression until it's absolutely needed. + This lets you create more efficient code and focus on what to compute + rather than how to compute it. ), - buttonText: "Enjoy the Ride", - showcase: { code: "", language: "" }, + buttonText: "Get Lazy, Be Efficient", + showcase: { + language: "haskell", + code: `let infiniteList = [1..] +let doubledList = List.map (*2) infiniteList +print (List.toString doubledLis)`, + }, }, { - title: "Focus-Driven, Event-Driven", + title: "Fearless Concurrency", description: ( <> - In NeoHaskell, you work directly events and functions that react to - them. Say goodbye to the cognitive overhead of managing state or - wrestling with dependency injection. Your focus stays where it belongs: - on solving problems and crafting solutions. +

+ Concurrency is not an afterthought in NeoHaskell; it's baked right in. + Write concurrent code without the common pitfalls, and get more done, + faster. +

+
+

+ Functions like async and race make it easy + to write concurrent code. And with concepts like Channels, you'll be + able to write concurrent code without the headaches. +

), - buttonText: "Begin your Journey", - showcase: { code: "", language: "" }, + buttonText: "Unlock Concurrency", + showcase: { + language: "haskell", + code: `foo = do + threadDelay 500 + print "foo" + +bar = do + threadDelay 1000 + print "bar" + +-- will print "foo" and exit +main = race foo bar`, + }, }, { - title: "Naturally Full-Stack", + title: "Event Sourcing and CQRS Ready", description: ( <> - Relish the ease of crafting full-stack applications in a unified - language environment. NeoHaskell takes care of frontend-backend - communication, allowing you to focus solely on your application's logic. + NeoHaskell aligns well with modern architectural patterns like Event + Sourcing and CQRS, making it easier for you to build scalable and + maintainable systems. ), - buttonText: "Experience Bliss", - showcase: { code: "", language: "" }, + buttonText: "Build Modern Systems", + showcase: { + language: "haskell", + code: `reduction = do + myEvents <- getEvents "myAggregate" + return ( + Stream.reduce + myReducer + initialState + myEvents + )`, + }, }, ]; -- cgit