Success Kingsley
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee
  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    1
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Nigerian Programming Language Performance vs JavaScript and Python _An evidence-based analysis of performance characteristics in a Nigerian Pidgin English programming language_ ## Introduction Programming languages typically prioritize either performance or expressiveness. NaijaScript, inspired by Nigerian Pidgin English, takes a different approach: what if a language designed for cultural expression could also deliver competitive computational performance? To answer this question, we conducted rigorous performance benchmarking against established languages like JavaScript and Python. The results reveal insights about interpreter design and the relationship between language syntax and execution speed. ## What is NaijaScript? [NaijaScript](https://github.com/xosnrdev/naijascript) is an experimental scripting language that uses Nigerian Pidgin English syntax. Instead of writing `if (condition)`, you write `if to say (condition)`. Variable assignment becomes `make x get 5` rather than `let x = 5`. Here's NaijaScript syntax: ```naijascript # Fibonacci calculation do fibonacci(n) start if to say (n small pass 2) start return n end if not so start return fibonacci(n minus 1) add fibonacci(n minus 2) end end make result get fibonacci(10) shout("Result: {result}") ``` The language implements a tree-walking interpreter written in Rust, using arena allocation for memory management and SIMD-optimized string operations. ## Methodology: Ensuring Fair Comparison Before examining results, understanding the benchmark methodology is essential for interpreting the findings. ### Algorithm Equivalence Every benchmark implements **identical algorithms** across all three languages. For example, the recursive Fibonacci implementation uses the same O(2^n) algorithm whether written in NaijaScript, JavaScript, or Python. No language receives algorithmic advantages. ### Statistical Protocol We used [hyperfine](https://github.com/sharkdp/hyperfine), a command-line benchmarking tool that: - Runs each test 12 times for statistical confidence - Includes one warmup run to eliminate cold-start effects - Measures with high precision timing - Calculates both mean execution time and standard deviation ### Environment Controls All tests ran on identical hardware (Apple M2) with consistent software versions: - **NaijaScript**: 0.11.4 - **Node.js**: v24.4.1 (V8 engine) - **Python**: 3.13.3 (CPython) Process isolation ensures no interference between measurements. ## Benchmark Results The benchmark results show varied performance characteristics across different algorithmic tasks: ### NaijaScript Leads in 5 of 7 Categories Across seven different algorithmic challenges, NaijaScript achieved the fastest execution time in five categories: - Iterative Fibonacci calculation - Prime number counting - String interpolation - String manipulation - Mathematical built-in functions ### Performance Patterns **Mathematical Operations**: NaijaScript demonstrates strong performance in computational tasks: - Iterative Fibonacci: **18.8× faster** than JavaScript - Prime counting: **2.4× faster** than JavaScript - Math functions: **6.5× faster** than JavaScript **Performance Gaps**: Two areas show significant performance disadvantages: - String concatenation: **7.7× slower** than Python - Recursive Fibonacci: **8.5× slower** than JavaScript ### Measurement Precision Most results show low variance (standard deviation < 10% of mean), indicating consistent performance. Where variance exceeds this threshold, we report explicit error margins in our measurements. ## Technical Analysis ### Performance Characteristics These performance patterns suggest several technical factors: 1. **Arena Memory Management**: NaijaScript's arena allocation strategy may reduce garbage collection overhead in mathematical computations. 2. **String Processing Architecture**: The performance gap in string concatenation suggests optimization opportunities in the string handling implementation. 3. **Recursion Overhead**: The tree-walking interpreter shows different performance characteristics for recursive vs iterative constructs. ### Language Design Implications The results demonstrate that syntax choice and execution speed operate largely independently. NaijaScript's Pidgin English keywords (`make`, `jasi`, `if to say`) don't inherently impact performance. The underlying interpreter architecture determines execution characteristics. ## Performance Data ![Performance Comparison](https://raw.githubusercontent.com/xosnrdev/naijascript/f37606d6dacf72df635c5287c8451905ffd4290d/benchmarks/results/charts/performance_comparison.png) ![Relative Performance](https://raw.githubusercontent.com/xosnrdev/naijascript/f37606d6dacf72df635c5287c8451905ffd4290d/benchmarks/results/charts/relative_performance.png) ## Language Design Insights These results provide several observations for language implementers: ### Syntax Independence from Performance NaijaScript demonstrates that culturally relevant syntax doesn't require computational trade-offs. The choice of keywords (`make` vs `let`, `jasi` vs `while`) has minimal impact on execution speed. ### Implementation Architecture Matters Performance differences stem primarily from interpreter design choices: - Memory management strategy (arena vs garbage collection) - Optimization techniques and compiler implementation - Runtime system architecture ### Task-Specific Performance Profiles Each language shows distinct strengths across different computational tasks: - **NaijaScript**: Mathematical computation and string interpolation - **JavaScript**: Recursive algorithms and string concatenation - **Python**: String operations and general-purpose computing ## Limitations and Context ### Scope of Measurement These benchmarks measure execution speed only. They don't evaluate: - Development productivity - Code maintainability - Learning curve - Memory usage patterns - Compilation or startup time ### Representative Workloads The algorithmic benchmarks (Fibonacci, prime counting) may not represent typical application workloads. Real-world software involves different performance requirements and usage patterns. ### Optimization Potential The NaijaScript interpreter remains in active development with optimization opportunities: - Bytecode compilation could improve recursive algorithm performance - String concatenation optimization could address the identified performance gap - Additional compiler optimizations could enhance mathematical operations ## Reproducibility All benchmark code, measurement scripts, and results are available in the [NaijaScript repository](https://github.com/xosnrdev/naijascript/tree/f37606d6dacf72df635c5287c8451905ffd4290d/benchmarks). You can reproduce these results by: ```bash git clone https://github.com/xosnrdev/naijascript.git cd naijascript/benchmarks ./run_benchmarks.sh ``` The methodology follows academic standards for programming language evaluation, with detailed documentation available in [METHODOLOGY.md](https://github.com/xosnrdev/naijascript/blob/f37606d6dacf72df635c5287c8451905ffd4290d/benchmarks/METHODOLOGY.md). ## Conclusion NaijaScript's benchmark results demonstrate that cultural expression and computational performance can coexist in programming language design. By achieving fastest execution in 5 of 7 benchmark categories, NaijaScript shows that interpreter architecture, not syntax choice, primarily determines performance characteristics. These findings suggest that language designers need not compromise between cultural relevance and computational efficiency. The implementation quality of the underlying interpreter matters more than the specific keywords or syntax used. The benchmark data provides evidence-based guidance for evaluating programming languages across different computational tasks. Performance requirements should be considered in the context of specific use cases rather than general assumptions about language categories. --- **Try NaijaScript**: Online playground available at [naijascript-playground.pages.dev](https://naijascript-playground.pages.dev)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully