GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - projects-misc/sdgscript: 🌍 TypeScript superset for SDGs-aware programming. Write sustainable code aligned with UN Sustainable Development Goals through static analysis, runtime monitoring, and developer tools.

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
examples
examples
 
 
packages
packages
 
 
src
src
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
PROJECT_SUMMARY.md
PROJECT_SUMMARY.md
 
 
README.md
README.md
 
 
package.json
package.json
 
 
screenshot.png
screenshot.png
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

🌍 SDGScript

npm version License: MIT TypeScript SDGs

A TypeScript superset for SDGs-aware programming - Write sustainable code that contributes to the United Nations Sustainable Development Goals.

SDGScript Screenshot

✨ Features

  • 🔄 Full TypeScript Compatibility: Use existing TypeScript code seamlessly
  • 📝 SDGs Annotations: JSDoc-style syntax for expressing SDGs compliance
  • 🔍 Static Analysis: AST-based carbon footprint and resource usage prediction
  • ⚡ Runtime Monitoring: Optional real-time resource tracking
  • 🛠️ Developer Tools: VSCode extension, ESLint plugin, and report generation
  • 📊 Impact Measurement: Quantify your code's environmental and social impact

🚀 Quick Start

Installation

npm install -g sdgscript

1. Initialize a Project

mkdir my-sdg-project
cd my-sdg-project
sdgscript init
npm install

2. Add SDGs Annotations

/**
 * @sdg Goal13 ClimateAction
 * @carbonBudget 1.5kWh
 * @impact environment high
 * @description Efficiently process climate data
 */
async function processClimateData(data: ClimateRecord[]): Promise<ProcessedData> {
  return withSDGContext({
    goal: 'Goal13_ClimateAction',
    carbonBudget: 1.5
  }, async () => {
    // Your efficient implementation here
    trackResource('computation', { energy: 0.8, emissions: 400 });
    return processedData;
  });
}

3. Analyze Your Code

# Generate comprehensive SDGs compliance report
sdgscript analyze src/ --format html -o sdg-report.html

# Check specific metrics
sdgscript analyze src/ --format json | jq '.summary'

4. Integrate with Your Workflow

// .eslintrc.json
{
  "extends": ["@typescript-eslint/recommended"],
  "plugins": ["@sdgscript/eslint-plugin"],
  "rules": {
    "@sdgscript/require-sdg-annotation": "warn",
    "@sdgscript/avoid-inefficient-loops": "error",
    "@sdgscript/limit-network-calls": "warn"
  }
}

📦 Architecture

sdgscript/
├── 🧠 packages/core/           # AST transformation & analysis engine
├── 💻 packages/cli/            # Command-line tools
├── 🔧 packages/eslint-plugin/  # ESLint integration
├── ⚡ packages/runtime/        # Runtime monitoring APIs
└── 🎨 packages/vscode-extension/ # VSCode language support

🎯 SDGs Integration

Supported Goals

Goal Focus Area Programming Context
Goal 7 Clean Energy Energy-efficient algorithms, optimization
Goal 13 Climate Action Carbon footprint reduction, green computing
Goal 4 Quality Education Accessible technology, digital inclusion
Goal 5 Gender Equality Bias detection, inclusive design
Goal 12 Responsible Consumption Resource efficiency, caching strategies

Example: Climate Data Processing

/**
 * @sdg Goal13 ClimateAction
 * @carbonBudget 2.0kWh
 * @impact environment critical
 */
export async function analyzeGlobalTemperatureData(
  sensors: SensorData[]
): Promise<ClimateInsights> {
  return withSDGContext({
    goal: 'Goal13_ClimateAction',
    carbonBudget: 2.0,
    description: 'Global temperature trend analysis for climate action'
  }, async () => {
    // Efficient batch processing to minimize energy consumption
    const insights = await processInBatches(sensors, 100);
    
    trackResource('climate_analysis', {
      energy: 1.8,
      emissions: 900, // gCO₂
      dataPoints: sensors.length
    });
    
    return insights;
  });
}

📊 Impact Measurement

SDGScript automatically tracks and reports:

  • 🔋 Energy Consumption: kWh estimates for code execution
  • 🌱 Carbon Emissions: CO₂ equivalent calculations
  • ⚡ Performance Metrics: Algorithm efficiency analysis
  • 📈 SDGs Score: 0-100 compliance rating
  • 💡 Optimization Suggestions: Actionable improvement recommendations

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Setup

git clone https://github.com/yuis-ice/sdgscript.git
cd sdgscript
npm install
npm run build
npm test

📄 License

MIT License - see LICENSE file for details.

🌟 Acknowledgments

  • Built with TypeScript and ts-morph
  • Inspired by the UN Sustainable Development Goals
  • Carbon calculation models based on Green Software Foundation research

Built with 💚 for a sustainable future

About

🌍 TypeScript superset for SDGs-aware programming. Write sustainable code aligned with UN Sustainable Development Goals through static analysis, runtime monitoring, and developer tools.

github.com/yuis-ice/sdgscript

Topics

carbon-awareclimate-actiondeveloper-toolseslint-plugingreen-codinggreen-softwaresdgsstatic-analysissustainabilitytypescript

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.